summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* config: don't special-case multivars that don't exist yetcmn/multivar-set-lockedCarlos Martín Nieto2016-03-212-18/+1
| | | | | | | | | | This special-casing ignores that we might have a locked file, so the hashtable does not represent the contents of the file we want to write. This causes multivar writes to overwrite entries instead of add to them when under lock. There is no need for this as the normal code-path will write to the file just fine, so simply get rid of it.
* Merge pull request #3699 from libgit2/cmn/win32-free-tlsEdward Thomson2016-03-181-0/+14
|\ | | | | win32: free thread-local data on thread exit
| * win32: free thread-local data on thread exitcmn/win32-free-tlsCarlos Martin Nieto2016-03-181-0/+14
| |
* | Merge pull request #3660 from mstrap/mingwEdward Thomson2016-03-181-0/+2
|\ \ | | | | | | MinGW builds should optionally create DLLs without "lib" prefix
| * | Option "LIBGIT2_PREFIX" to set the CMAKE's TARGET_PROPERTIES PREFIXMarc Strapetz2016-03-151-0/+2
| | | | | | | | | | | | | | | This is especially useful in combination with MinGW to yield the Windows-compliant DLL name "git2.dll" instead of "libgit2.dll"
* | | Merge pull request #3564 from ethomson/merge_driversCarlos Martín Nieto2016-03-1711-115/+1309
|\ \ \ | | | | | | | | Custom merge drivers and proper gitattributes `merge` handling
| * | | merge drivers: handle configured but not found driverEdward Thomson2016-03-172-4/+31
| | | |
| * | | merge driver: remove `check` callbackEdward Thomson2016-03-176-306/+81
| | | | | | | | | | | | | | | | | | | | | | | | Since the `apply` callback can defer, the `check` callback is not necessary. Removing the `check` callback further makes the `payload` unnecessary along with the `cleanup` callback.
| * | | merge driver: improve inline documentationEdward Thomson2016-03-171-18/+21
| | | |
| * | | merge driver: correct global initializationEdward Thomson2016-03-175-94/+160
| | | |
| * | | merge driver: get a pointer to favorEdward Thomson2016-03-172-4/+9
| | | |
| * | | merge driver: correct indentationEdward Thomson2016-03-172-30/+30
| | | |
| * | | merge driver: tests for set and unset merge attributeEdward Thomson2016-03-171-1/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure that setting the merge attribute forces the built-in default `text` driver and does *not* honor the `merge.default` configuration option. Further ensure that unsetting the merge attribute forces a conflict (the `binary` driver).
| * | | merge driver: tests for custom default merge driversEdward Thomson2016-03-171-0/+59
| | | |
| * | | merge driver: allow custom default driverEdward Thomson2016-03-175-43/+88
| | | | | | | | | | | | | | | | | | | | | | | | Allow merge users to configure a custom default merge driver via `git_merge_options`. Similarly, honor the `merge.default` configuration option.
| * | | merge driver: test GIT_EMERGECONFLICTEdward Thomson2016-03-171-0/+90
| | | | | | | | | | | | | | | | | | | | When a `check` or `apply` callback function returns `GIT_EMERGECONFLICT` stop and product a conflict.
| * | | merge driver: test GIT_PASSTHROUGHEdward Thomson2016-03-171-0/+95
| | | | | | | | | | | | | | | | | | | | When a `check` or `apply` callback function returns `GIT_PASSTHROUGH`, move on to the default merge driver.
| * | | merge driver: introduce custom merge driversEdward Thomson2016-03-176-129/+1061
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consumers can now register custom merged drivers with `git_merge_driver_register`. This allows consumers to support the merge drivers, as configured in `.gitattributes`. Consumers will be asked to perform the file-level merge when a custom driver is configured.
| * | | Fix rebase bug and include test for merge=unionStan Hu2016-03-172-1/+37
| | | |
| * | | Support union merges via .gitattributes fileStan Hu2016-03-171-0/+26
| | | |
* | | | Merge pull request #3695 from ethomson/contributingCarlos Martín Nieto2016-03-171-1/+16
|\ \ \ \ | |/ / / |/| | | CONTRIBUTING: document the optional tests
| * | | CONTRIBUTING: document the optional testsEdward Thomson2016-03-171-1/+16
|/ / /
* | | Merge pull request #3673 from libgit2/cmn/commit-with-signatureEdward Thomson2016-03-173-0/+185
|\ \ \ | | | | | | | | commit: add function to attach a signature to a commit
| * | | commit: add function to attach a signature to a commitcmn/commit-with-signatureCarlos Martín Nieto2016-03-153-0/+185
| | | | | | | | | | | | | | | | | | | | In combination with the function which creates a commit into a buffer, this allows us to more easily create signed commits.
* | | | Merge pull request #3685 from pks-t/pks/memleaksEdward Thomson2016-03-172-20/+19
|\ \ \ \ | | | | | | | | | | Test memleaks
| * | | | tests: transport: fix memory leaks with registering transportsPatrick Steinhardt2016-03-111-18/+17
| | | | |
| * | | | tests: nsec: correctly free nsec_pathPatrick Steinhardt2016-03-111-2/+2
| |/ / / | | | | | | | | | | | | | | | | | | | | git_buf_clear does not free allocated memory associated with a git_buf. Use `git_buf_free` instead to correctly free its memory and plug the memory leak.
* | | | Merge pull request #3687 from mstrap/CMAKE_C_FLAGS_DEBUGEdward Thomson2016-03-171-2/+2
|\ \ \ \ | | | | | | | | | | CMake: do not overwrite but only append to CMAKE_C_FLAGS_DEBUG
| * | | | CMake: do not overwrite but only append to CMAKE_C_FLAGS_DEBUGMarc Strapetz2016-03-151-2/+2
| | |/ / | |/| | | | | | | | | | | | | | | | | | This is useful to force "smart" IDEs (like CLIon) to use debug flag -g even it may have decided that "-D_DEBUG" (which is already present) is sufficient.
* | | | Merge pull request #3693 from libgit2/cmn/extract-oneline-sigEdward Thomson2016-03-172-1/+25
|\ \ \ \ | |_|_|/ |/| | | commit: fix extraction of single-line signatures
| * | | commit: fix extraction of single-line signaturescmn/extract-oneline-sigCarlos Martín Nieto2016-03-172-1/+25
|/ / / | | | | | | | | | | | | | | | | | | | | | The function to extract signatures suffers from a similar bug to the header field finding one by having an unecessary line feed check as a break condition of its loop. Fix that and add a test for this single-line signature situation.
* | | Merge pull request #3690 from libgit2/cmn/pool-limitEdward Thomson2016-03-165-9/+41
|\ \ \ | | | | | | | | win32: choose the page size as our value for the page size
| * | | Split the page size from the mmap alignmentcmn/pool-limitCarlos Martín Nieto2016-03-165-9/+41
|/ / / | | | | | | | | | | | | | | | | | | | | | While often similar, these are not the same on Windows. We want to use the page size on Windows for the pools, but for mmap we need to use the allocation granularity as the alignment. On the other platforms these values remain the same.
* | | Merge pull request #3677 from pks-t/pks/coverity-fixes-round7Carlos Martín Nieto2016-03-146-14/+39
|\ \ \ | | | | | | | | Coverity fixes round 7
| * | | config_cache: check return value of `git_config__lookup_entry`Patrick Steinhardt2016-03-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Callers of `git_config__cvar` already handle the case where the function returns an error due to a failed configuration variable lookup, but we are actually swallowing errors when calling `git_config__lookup_entry` inside of the function. Fix this by returning early when `git_config__lookup_entry` returns an error. As we call `git_config__lookup_entry` with `no_errors == false` which leads us to call `get_entry` with `GET_NO_MISSING` we will not return early when the lookup fails due to a missing entry. Like this we are still able to set the default value of the cvar and exit successfully.
| * | | filebuf: handle write error in `lock_file`Patrick Steinhardt2016-03-111-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | When writing to a file with locking not check if writing the locked file actually succeeds. Fix the issue by returning error code and message when writing fails.
| * | | config_file: handle error when trying to lock strmapPatrick Steinhardt2016-03-111-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Accessing the current values map is handled through the `refcounder_strmap_take` function, which first acquires a mutex before accessing its values. While this assures everybody is trying to access the values with the mutex only we do not check if the locking actually succeeds. Fix the issue by checking if acquiring the lock succeeds and returning `NULL` if we encounter an error. Adjust callers.
| * | | blame: handle error when resoling HEAD in normalize_optionsPatrick Steinhardt2016-03-111-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When normalizing options we try to look up HEAD's OID. While this action may fail in malformed repositories we never check the return value of the function. Fix the issue by converting `normalize_options` to actually return an error and handle the error in `git_blame_file`.
| * | | blame_git: handle error returned by `git_commit_parent`Patrick Steinhardt2016-03-111-1/+2
| | | |
| * | | refdb_fs: fail if refcache returns NULL pointerPatrick Steinhardt2016-03-111-0/+1
| | |/ | |/| | | | | | | | | | | | | | | | | | | We usually check entries returned by `git_sortedcache_entry` for NULL pointers. As we have a write lock in `packed_write`, though, it really should not happen that the function returns NULL. Assert that ref is not NULL to silence a Coverity warning.
* | | Merge pull request #3647 from pks-t/pks/coverity-fixes-round6Carlos Martín Nieto2016-03-148-17/+45
|\ \ \ | | | | | | | | Coverity fixes round 6
| * | | coverity: report errors when uploading tarballPatrick Steinhardt2016-03-111-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Curl by default does not report errors by setting the error code. As the upload can fail through several conditions (e.g. the rate limit, leading to unauthorized access) we should indicate this information in Travis CI. To improve upon the behavior, use `--write-out=%{http_code}` to write out the HTTP code in addition to the received body and return an error if the code does not equal 201.
| * | | diff_tform: fix potential NULL pointer accessPatrick Steinhardt2016-03-111-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the user passes in a diff which has no repository associated we may call `git_config__get_int_force` with a NULL-pointer configuration. Even though `git_config__get_int_force` is designed to swallow errors, it is not intended to be called with a NULL pointer configuration. Fix the issue by only calling `git_config__get_int_force` only when configuration could be retrieved from the repository.
| * | | submodule: avoid passing NULL pointers to strncmpPatrick Steinhardt2016-03-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In C89 it is undefined behavior to pass `NULL` pointers to `strncmp` and later on in C99 it has been explicitly stated that functions with an argument declared as `size_t nmemb` specifying the array length shall always have valid parameters, no matter if `nmemb` is 0 or not (see ISO 9899 §7.21.1.2). The function `str_equal_no_trailing_slash` always passes its parameters to `strncmp` if their lengths match. This means if one parameter is `NULL` and the other one either `NULL` or a string with length 0 we will pass the pointers to `strncmp` and cause undefined behavior. Fix this by explicitly handling the case when both lengths are 0.
| * | | pack-objects: fix memory leak on overflowPatrick Steinhardt2016-03-111-1/+3
| | | |
| * | | index: assert required OID are non-NULLPatrick Steinhardt2016-03-111-3/+9
| | | |
| * | | object: avoid call of memset with ouf of bounds pointerPatrick Steinhardt2016-03-111-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When computing a short OID we do this by first copying the leading parts into the new OID structure and then setting the trailing part to zero. In the case of the desired length being `GIT_OID_HEXSZ - 1` we will call `memset` with an out of bounds pointer and a length of 0. While this seems to cause no problems for common platforms the C89 standard does not explicitly state that calling `memset` with an out of bounds pointer and length of 0 is valid. Fix the potential issue by using the newly introduced `git_oid__cpy_prefix` function.
| * | | config_file: handle missing quotation marks in section headerPatrick Steinhardt2016-03-101-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When parsing a section header we expect something along the format of '[section "subsection"]'. When a section is mal-formated and is entirely missing its quotation marks we catch this case by observing that `strchr(line, '"') - strrchr(line, '"') = NULL - NULL = 0` and error out. Unfortunately, the error message is misleading though, as we state that we are missing the closing quotation mark while we in fact miss both quotation marks. Improve the error message by explicitly checking if the first quotation mark could be found and, if not, stating that quotation marks are completely missing.
| * | | describe: handle error code returned by git_pqueue_insertPatrick Steinhardt2016-03-101-1/+2
| |/ /
* | | Merge pull request #3671 from libgit2/cmn/remove-mingw32Edward Thomson2016-03-144-25/+1
|\ \ \ | | | | | | | | Remove CI support for mingw32