summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | proxy: fix crash on remote connection with GIT_PROXY_AUTO but no proxy is ↵Jason Haslam2019-01-142-0/+10
| | | | | | | | | | | | | | | | | | | | detected
* | | | | Merge pull request #4924 from lhchavez/werrorEdward Thomson2019-01-102-10/+9
|\ \ \ \ \ | | | | | | | | | | | | Make ENABLE_WERROR actually work
| * | | | | Make ENABLE_WERROR actually worklhchavez2019-01-102-10/+9
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change explicitly adds -Werror to the CFLAGS. Due to the way that the ADD_C_FLAG_IF_SUPPORTED() macro was mangling the flag name to convert it into a define name, any warning that had a dash in its name was not being correctly enabled. Additionally, any flag that is enabled implicitly by the compiler (like -Wunused-result and -Wdeprecated-declarations) would not cause an error unless they were explicitly enabled with the ENABLE_WARNINGS() macro.
* | | | | Merge pull request #4931 from tiennou/cmake/osx-deprecated-warnEdward Thomson2019-01-101-3/+0
|\ \ \ \ \ | |/ / / / |/| | | | Remove unconditional -Wno-deprecated-declaration on macOS
| * | | | cmake: remove unconditional -Wno-deprecated-declaration on APPLEEtienne Samson2019-01-101-3/+0
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After taking into consideration the following, I think this should be removed : - OpenSSL isn't the default on Apple platforms - you have to jump through hoops to get CMake to use OpenSSL on macOS (headers aren't in `/usr/include`, so you have to provide `-DOPENSSL_*` overrides) - users are likely (as getting anywhere near the installed 0.9.8 version is insanity IMHO) to package a "modern" version, which wouldn't be marked as deprecated
* | | | Merge pull request #4926 from csware/warning-c4133Edward Thomson2019-01-091-1/+1
|\ \ \ \ | | | | | | | | | | Fix warning 'function': incompatible types - from 'git_cvar_value *' to 'int *' (C4133) on VS
| * | | | Fix warning 'function': incompatible types - from 'git_cvar_value *' to 'int ↵Sven Strickroth2019-01-071-1/+1
| | |/ / | |/| | | | | | | | | | | | | | | | | | *' (C4133) on VS Signed-off-by: Sven Strickroth <email@cs-ware.de>
* | | | Merge pull request #4928 from lhchavez/fix-warningsEdward Thomson2019-01-092-9/+9
|\ \ \ \ | |_|_|/ |/| | | Fix Linux warnings
| * | | Fix Linux warningslhchavez2019-01-082-9/+9
|/ / / | | | | | | | | | | | | This change fixes -Wmaybe-uninitialized and -Wdeprecated-declarations warnings on Linux builds
* | | Merge pull request #4922 from tiennou/fix/coverity-cidsEdward Thomson2019-01-086-1/+32
|\ \ \ | |/ / |/| | Coverity fixes
| * | coverity: attempt to model clar's assertionsEtienne Samson2019-01-041-0/+23
| | | | | | | | | | | | | | | | | | Coverity considers that anything that looks like assert() behaves like it (ie. side-effects would be skipped on a NDEBUG build). As we have a bunch of those in the test suite (128), this would ensure Coverity isn't confused.
| * | tests: add missing assertsEtienne Samson2019-01-041-0/+2
| | | | | | | | | CID 1398597, 1398598
| * | refs: assert that we're passed valid refs when renamingEtienne Samson2019-01-041-0/+2
| | | | | | | | | CID 1382962
| * | diff: assert that we're passed a valid git_diff objectEtienne Samson2019-01-041-0/+2
| | | | | | | | | CID 1386176, 1386177, 1388219
| * | submodule: grab the error while loading from configEtienne Samson2019-01-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Previously, an error in `git_config_next` would be mistaken as a successful load, because the previous call would have succeeded. Coverity saw the subsequent check for a completed iteration as dead, so let's make it useful again. CID 1391374
| * | config: assert that our parameters are validEtienne Samson2019-01-041-0/+2
|/ / | | | | CID 1395011
* | Merge pull request #4919 from pks-t/pks/shutdown-cb-countEdward Thomson2019-01-037-20/+49
|\ \ | | | | | | Shutdown callback count
| * | global: move init callbacks into an arrayPatrick Steinhardt2019-01-021-14/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently have an explicit callchain of all the initialization callbacks in our `init_common` function. This is perfectly fine, but requires us to manually keep track of how many shutdown callbacks there may be installed: to avoid allocations before libgit2 is fully initialized, we assume that every initializer may register at most one shutdown function. These shutdown functions are stored in a static array of size `MAX_SHUTDOWN_CB`, which then needs to be updated manually whenever a new initializer function is being added. The situation can be easily fixed: convert the callchain of init functions into an array and iterate over it to initialize all subsystems. This allows us to define the `git__shutdown_callbacks` array with the same size as the initializer array and rids us of the need to always update `MAX_SHUTDOWN_CB`.
| * | hash: convert `global_init` macros to real functionPatrick Steinhardt2019-01-026-6/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `git_hash_global_init` function is simply defined as a macro to zero for most of the different hash implementations. This makes it impossible to treat it like a function pointer, which is required for a later commit where we want to improve the way global initialization works. Fix the issue by converting all no-op macros to an inline function returning zero. There's a small gotcha here, though: as most hash implementations only have a header file, but not a corresponding implementation file, we cannot declare the function as non-static. But declaring it as `static inline` fails, too, as there is a previous declaration as non-static. So we have to move the function declaration after the include that brings in the function definition, as it is allowed to have a non-static declaration after a static definition, but not the other way round.
* | | Merge pull request #4904 from libgit2/ethomson/crlfEdward Thomson2019-01-037654-238/+33402
|\ \ \ | | | | | | | | Update CRLF filtering to match modern git
| * | | checkout::crlf: ensure successethomson/crlfEdward Thomson2018-12-191-30/+33
| | | | | | | | | | | | | | | | | | | | Wrap function calls in the `checkout::crlf` tests with `cl_git_pass`, `cl_assert`, etc. to ensure that they're successful.
| * | | Additional core.autocrlf and core.safecrlf testsSven Strickroth2018-12-032-3/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a cherry-pick of the tests from the following commits: core.autocrlf=true and core.safecrlf=true did not fail on LF-only file as vanilla git does Adding a CRLF-file with core.autocrlf=input and core.safecrlf=true does not fail as with vanilla git Make files with #CR!=#CRLF not fail with core.safecrlf=true Reported-by: Yue Lin Ho <b8732003@student.nsysu.edu.tw> Signed-off-by: Sven Strickroth <email@cs-ware.de>
| * | | crlf: update to match git's logicEdward Thomson2018-12-033-201/+215
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Examine the recent CRLF changes to git by Torsten Bögershausen and include similar changes to update our CRLF logic to match. Note: Torsten Bögershausen has previously agreed to allow his changes to be included in libgit2.
| * | | index::crlf: better error reporting in core git testsEdward Thomson2018-12-031-8/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't simply fail when the expected output does not match the data in the index; instead, provide a detailed output about the system, file, and settings that caused the failure so that developers can better isolate the problem(s).
| * | | index::crlf: simplify test caseEdward Thomson2018-12-031-60/+42
| | | |
| * | | crlf tests: use known-good data produced by gitSven Strickroth2018-12-031-1/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given a variety of combinations of core.autocrlf, core.safecrlf settings and attributes settings, test that we add files to index the same way (regarding OIDs and fatal errors) as a known-good test resource created by git.git. Signed-off-by: Sven Strickroth <email@cs-ware.de>
| * | | crlf_data: add corpus of known-good odb-filtered dataEdward Thomson2018-12-036257-0/+32690
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the crlf data scripts to produce a corpus of known-good data in "git" format (aka ODB format) from a variety of files with different line endings. `git` created these files running `git add` to stage the contents then extracting the data from the repository. We'll use these to ensure that we create identical contents when we add files into the index.
| * | | crlf: re-use existing crlf script to create odbEdward Thomson2018-12-0322-118/+63
| | | | | | | | | | | | | | | | | | | | | | | | Re-use the existing crlf data generation script for creating the to-odb dataset. Also, store the actual file contents instead of the ID so that we can identify differences instead of detecting that differences exist.
| * | | crlf: script to generate expected crlf data for adding files to indexSven Strickroth2018-12-0322-3/+232
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Include a shell script that will generate the expected data of OIDs and failures for calling git.git to capture its output as a test resource. Right now, there is no need to differentiate different systems as git behaves the same on all systems IIRC. Signed-off-by: Sven Strickroth <email@cs-ware.de>
| * | | checkout::crlf clear the crlf workdir for checkoutEdward Thomson2018-12-031-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | After sandboxing the crlf directory, remove the working directory contents. This allows us to package data within the crlf directory (for simplicity, this allows us to script the to-odb and to-workdir crlf filter conversion data in a single location).
| * | | crlf_data: move to a "to_workdir" folderEdward Thomson2018-12-031371-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the crlf_data folders reponsible for holding the state of the filters going into the working directory to "to_workdir" variations of the folder name to accommodate future growth into the "to odb" filter variation. Update the script to create these new folders as appopriate.
* | | | Merge pull request #4915 from pks-t/pks/refdb-minor-refactoringsEdward Thomson2018-12-191-12/+11
|\ \ \ \ | | | | | | | | | | refdb_fs: refactor error handling in `refdb_reflog_fs__delete`
| * | | | refdb_fs: refactor error handling in `refdb_reflog_fs__delete`Patrick Steinhardt2018-12-191-12/+11
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function `refdb_reflog_fs__delete` uses the `if (!error && foobar())` pattern of checking, where error conditions are being checked by following calls to different code. This does not match our current style, where the call-site of a function is usually directly responsible for checking the return value. Convert the function to use `if ((error = foobar()) < 0) goto out;` style. Note that this changes the code flow a bit: previously, we were always trying to delete empty reference hierarchies even if deleting the reflog entry has failed. This wasn't much of a problem -- if deletion failed, the hierarchy will still contain at least one file and thus the function call was an expensive no-op. Now, we will only perform this deletion if we have successfully removed the reflog.
* | | | Merge pull request #4833 from csware/drop-empty-dirsPatrick Steinhardt2018-12-192-2/+88
|\ \ \ \ | | | | | | | | | | Remove empty (sub-)directories when deleting refs
| * | | | Remove empty directories when deleting refsSven Strickroth2018-10-132-2/+88
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
* | | | | Merge pull request #4910 from libgit2/cmn/annotated-from-tagPatrick Steinhardt2018-12-194-12/+39
|\ \ \ \ \ | | | | | | | | | | | | Support creating annotated commits from annotated tags
| * | | | | annotated_commit: peel to commit instead of assuming we have onecmn/annotated-from-tagCarlos Martín Nieto2018-12-141-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We want to allow the creation of annotated commits out of annotated tags and for that we have to peel the reference all the way to the commit instead of stopping at the first id it provides.
| * | | | | refs: constify git_reference_peelCarlos Martín Nieto2018-12-142-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have no need to take a non-const reference. This does involve some other work to make sure we don't mix const and non-const variables, but by splitting what we want each variable to do we can also simplify the logic for when we do want to free a new reference we might have allocated.
| * | | | | annotated_commit: add failing test for looking up from annotated tagCarlos Martín Nieto2018-12-141-0/+26
|/ / / / /
* | | | | Merge pull request #4906 from QBobWatson/bugfixEdward Thomson2018-12-061-5/+9
|\ \ \ \ \ | | | | | | | | | | | | Fix segfault in loose_backend__readstream
| * | | | | Typesetting conventionsJoe Rabinoff2018-12-061-9/+9
| | | | | |
| * | | | | Removed one null checkJoe Rabinoff2018-12-041-3/+2
| | | | | |
| * | | | | Fix segfault in loose_backend__readstreamJoe Rabinoff2018-12-041-5/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the routine exits with error before stream or hash_ctx is initialized, the program will segfault when trying to free them.
* | | | | | Merge pull request #4905 from palmin/proxy_stream_closeEdward Thomson2018-12-051-0/+6
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | | make proxy_stream_close close target stream even on errors
| * | | | | make proxy_stream_close close target stream even on errorsAnders Borum2018-12-041-0/+6
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When git_filter_apply_fn callback returns a error while smudging proxy_stream_close ends up returning without closing the stream. This is turn makes blob_content_to_file crash as it asserts the stream being closed whether there are errors or not. Closing the target stream on error fixes this problem.
* | | | | Merge pull request #4807 from libgit2/ethomson/index_fixesEdward Thomson2018-12-01145-974/+1032
|\ \ \ \ \ | |_|_|/ / |/| | | | Index API updates for consistency
| * | | | object_type: use new enumeration namesethomson/index_fixesEdward Thomson2018-12-01122-728/+731
| | | | | | | | | | | | | | | | | | | | Use the new object_type enumeration names within the codebase.
| * | | | index: use new enum and structure namesEdward Thomson2018-12-0125-151/+152
| | | | | | | | | | | | | | | | | | | | Use the new-style index names throughout our own codebase.
| * | | | object_type: update public API to use git_object_tEdward Thomson2018-12-018-42/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git_object_t is the future; update the public API to use it. This will also ensure that we can build our tests which make use of the old API without modification (and without compiler warnings).
| * | | | object_type: remove unused object type flagsEdward Thomson2018-12-011-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The two "reserved" bits in `git_object_t` are unused. They were included for completeness, but downstream users should never use them and they should not have been made public. These values are never set. With the refactoring of `git_otype` into `git_object_t`, we can remove these from the new API. They will remain in the old (deprecated) API in the unlikely event that someone was using them.