summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | | Merge pull request #3610 from ethomson/rebase_bareCarlos Martín Nieto2016-02-121-118/+251
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | rebase: introduce bare rebasing
| * | | | | | | rebase: allow custom merge_optionsEdward Thomson2016-02-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow callers of rebase to specify custom merge options. This may allow custom conflict resolution, or failing fast when conflicts are detected.
| * | | | | | | rebase: introduce inmemory rebasingEdward Thomson2016-02-111-117/+250
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce the ability to rebase in-memory or in a bare repository. When `rebase_options.inmemory` is specified, the resultant `git_rebase` session will not be persisted to disk. Callers may still analyze the rebase operations, resolve any conflicts against the in-memory index and create the commits. Neither `HEAD` nor the working directory will be updated during this process.
* | | | | | | Horrible fix for #3173.Arthur Schreiber2016-02-119-26/+28
| | | | | | |
* | | | | | | commit: don't forget the last header fieldCarlos Martín Nieto2016-02-111-1/+1
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we moved the logic to handle the first one, wrong loop logic was kept in place which meant we still finished early. But we now notice it because we're not reading past the last LF we find. This was not noticed before as the last field in the tested commit was multi-line which does not trigger the early break.
* | | | | | Merge pull request #3599 from libgit2/gpgsignVicent Marti2016-02-091-0/+86
|\ \ \ \ \ \ | | | | | | | | | | | | | | Introduce git_commit_extract_signature
| * | | | | | Introduce git_commit_extract_signaturegpgsignCarlos Martín Nieto2016-02-091-0/+86
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | This returns the GPG signature for a commit and its contents without the signature block, allowing for the verification of the commit's signature.
* | | | | | Merge pull request #3603 from pks-t/pks/coverity-fixesCarlos Martín Nieto2016-02-094-8/+14
|\ \ \ \ \ \ | | | | | | | | | | | | | | Coverity fixes
| * | | | | | attr_file: fix resource leakPatrick Steinhardt2016-02-091-2/+3
| | | | | | |
| * | | | | | checkout: fix resource leakPatrick Steinhardt2016-02-091-1/+3
| | | | | | |
| * | | | | | pack-objects: fix memory leak in packbuilder_configPatrick Steinhardt2016-02-091-4/+7
| | | | | | |
| * | | | | | pack-objects: fix memory leak in compute_write_orderPatrick Steinhardt2016-02-091-0/+1
| | | | | | |
| * | | | | | pack: do not free passed in poiter on errorPatrick Steinhardt2016-02-091-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function `git_packfile_stream_open` tries to free the passed in stream when an error occurs. The only call site is `git_indexer_append`, though, which passes in the address of a stream struct which has not been allocated on the heap. Fix the issue by simply removing the call to free. In case of an error we did not allocate any memory yet and otherwise it should be the caller's responsibility to manage it's object's lifetime.
* | | | | | | Merge pull request #3602 from libgit2/cmn/header-field-2Carlos Martín Nieto2016-02-091-17/+22
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | commit: also match the first header field when searching
| * | | | | | commit: also match the first header field when searchingcmn/header-field-2Carlos Martín Nieto2016-02-091-17/+22
| | |_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were searching only past the first header field, which meant we were unable to find e.g. `tree` which is the first field. While here, make sure to set an error message in case we cannot find the field.
* | | | | | curl_stream: fix unused cert infosPatrick Steinhardt2016-02-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When copying contents of the cURL certiinfo we duplicate the data but forget to actually put it into the vector.
* | | | | | merge: fix memory leakPatrick Steinhardt2016-02-081-3/+2
| |_|_|/ / |/| | | |
* | | | | Merge pull request #3578 from bubaflub/fix_small_memory_leakCarlos Martín Nieto2016-02-051-1/+4
|\ \ \ \ \ | | | | | | | | | | | | Free allocated pointer to curl stream on error
| * | | | | Free allocated pointer to curl stream on errorBob Kuo2016-01-161-1/+4
| | |/ / / | |/| | |
* | | | | winhttp: name mangle class / iid on mingwEdward Thomson2016-01-191-2/+7
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Standard Windows type systems define CLSID_InternetSecurityManager and IID_IInternetSecurityManager, but MinGW lacks these definitions. As a result, we must hardcode these definitions ourselves. However, we should not use a public struct with those names, lest another library do the same thing and consumers cannot link to both.
* | | | Make packfile_unpack_compressed a private APIP.S.V.R2016-01-132-9/+2
|/ / /
* | | Merge pull request #3562 from mgorny/ssh-read-stderr-failCarlos Martín Nieto2015-12-291-3/+8
|\ \ \ | | | | | | | | ssh_stream_read(): fix possible *bytes_read < 0 branch
| * | | ssh_stream_read(): fix possible *bytes_read < 0 branchMichał Górny2015-12-261-3/+8
| | |/ | |/| | | | | | | | | | | | | Fix the possibility of returning successfully from ssh_stream_read() with *bytes_read < 0. This would occur if stdout channel read resulted in 0, and stderr channel read failed afterwards.
* | | Merge pull request #3558 from libgit2/cmn/index-nolockCarlos Martín Nieto2015-12-282-131/+15
|\ \ \ | | | | | | | | index: get rid of the locking
| * | | index: get rid of the lockingcmn/index-nolockCarlos Martín Nieto2015-12-282-131/+15
| |/ / | | | | | | | | | | | | | | | | | | We don't support using an index object from multiple threads at the same time, so the locking doesn't have any effect when following the rules. If not following the rules, things are going to break down anyway.
* | | git_repository_init: include dotfiles when copying templatesEdward Thomson2015-12-261-1/+3
| |/ |/| | | | | | | | | Include dotfiles when copying template directory, which will handle both a template directory itself that begins with a dotfile, and any dotfiles inside the directory.
* | Merge pull request #3546 from Cruel/masterEdward Thomson2015-12-261-1/+1
|\ \ | |/ |/| Fix a couple function signatures
| * Fix a couple function signaturesThomas Edvalson2015-12-141-1/+1
| |
* | typos in commentsDmitriy Olshevskiy2015-12-211-1/+1
| |
* | index: Also size-hint the hash tablevmg/index-fill-2Vicent Marti2015-12-162-4/+3
| | | | | | | | | | | | | | Note that we're not checking whether the resize succeeds; in OOM cases, we let it run with a "small" vector and hash table and see if by chance we can grow it dynamically as we insert the new entries. Nothing to lose really.
* | index: Preallocate the entries vector with size hintVicent Marti2015-12-163-0/+16
| |
* | index: Adjust namemask & mode when fillingVicent Marti2015-12-161-14/+17
| |
* | merge: Use `git_index__fill` to populate the indexvmg/index-fillVicent Marti2015-12-163-5/+41
|/ | | | | | | | | | | | | Instead of calling `git_index_add` in a loop, use the new `git_index_fill` internal API to fill the index with the initial staged entries. The new `fill` helper assumes that all the entries will be unique and valid, so it can append them at the end of the entries vector and only sort it once at the end. It performs no validation checks. This prevents the quadratic behavior caused by having to sort the entries list once after every insertion.
* Merge pull request #3528 from chescock/Passthrough-from-credential-callbackEdward Thomson2015-12-141-1/+4
|\ | | | | Treat GIT_PASSTHROUGH as though git_cred_acquire_cb isn't set.
| * Treat GIT_PASSTHROUGH as though git_cred_acquire_cb isn't set.Chris Hescock2015-12-011-1/+4
| |
* | Merge pull request #3521 from pks-t/blame-line-overflowEdward Thomson2015-12-143-31/+37
|\ \ | | | | | | Line count overflow in git_blame_hunk and git_blame__entry
| * | blame: use size_t for line counts in git_blame__entryPatrick Steinhardt2015-12-012-19/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | The `git_blame__entry` struct keeps track of line counts with `int` fields. Since `int` is only guaranteed to be at least 16 bits we may overflow on certain platforms when line counts exceed 2^15. Fix this by instead storing line counts in `size_t`.
| * | blame: use size_t for line counts in git_blame_hunkPatrick Steinhardt2015-12-011-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is not unreasonable to have versioned files with a line count exceeding 2^16. Upon blaming such files we fail to correctly keep track of the lines as `git_blame_hunk` stores them in `uint16_t` fields. Fix this by converting the line fields of `git_blame_hunk` to `size_t`. Add test to verify behavior.
* | | Merge pull request #3522 from pks-t/email-format-commit-messageCarlos Martín Nieto2015-12-103-1/+39
|\ \ \ | | | | | | | | diff: include commit message when formatting patch
| * | | diff: include commit message when formatting patchPatrick Steinhardt2015-12-011-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | When formatting a patch as email we do not include the commit's message in the formatted patch output. Implement this and add a test that verifies behavior.
| * | | commit: introduce `git_commit_body`Patrick Steinhardt2015-12-012-0/+29
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | It is already possible to get a commit's summary with the `git_commit_summary` function. It is not possible to get the remaining part of the commit message, that is the commit message's body. Fix this by introducing a new function `git_commit_body`.
* | | Merge pull request #3538 from pks-t/pks/index-memory-leakCarlos Martín Nieto2015-12-101-1/+1
|\ \ \ | | | | | | | | index: always queue `remove_entry` for removal
| * | | index: always queue `remove_entry` for removalPatrick Steinhardt2015-12-081-1/+1
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When replacing an index with a new one, we need to iterate through all index entries in order to determine which entries are equal. When it is not possible to re-use old entries for the new index, we move it into a list of entries that are to be removed and thus free'd. When we encounter a non-zero error code, though, we skip adding the current index entry to the remove-queue. `INSERT_MAP_EX`, which is the function last run before adding to the remove-queue, may return a positive non-zero code that indicates what exactly happened while inserting the element. In this case we skip adding the entry to the remove-queue but still continue the current operation, leading to a leak of the current entry. Fix this by checking for a negative return value instead of a non-zero one when we want to add the current index entry to the remove-queue.
* | | reset: perform the checkout before moving HEAD or the indexcmn/reset-dir-fileCarlos Martín Nieto2015-12-091-6/+6
| | | | | | | | | | | | | | | | | | This keeps the state of the workdir the same as one from HEAD, removing a source of possible confusion when calculating the work that is to be done.
* | | Merge pull request #3539 from libgit2/typedef-submodule-cbCarlos Martín Nieto2015-12-081-1/+1
|\ \ \ | | | | | | | | Use a typedef for the submodule_foreach callback.
| * | | Use a typedef for the submodule_foreach callback.joshaber2015-12-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This fits with the style for the rest of the project, but more importantly, makes life easier for bindings authors who auto-generate code.
* | | | tree: mark a tree as already sortedcmn/tree-is-sortedCarlos Martín Nieto2015-12-061-1/+2
|/ / / | | | | | | | | | | | | The trees are sorted on-disk, so we don't have to go over them again. This cuts almost a fifth of time spent parsing trees.
* | | Merge pull request #3530 from libgit2/cmn/parse-modeEdward Thomson2015-12-031-5/+21
|\ \ \ | | | | | | | | tree: use a specialised mode parse function
| * | | tree: use a specialised mode parse functioncmn/parse-modeCarlos Martín Nieto2015-12-021-5/+21
| |/ / | | | | | | | | | | | | Instead of going out to strtol, which is made to parse generic numbers, copy a parse function from git which is specialised for file modes.
* | | index: canonicalize inserted paths safelyEdward Thomson2015-12-031-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When adding to the index, we look to see if a portion of the given path matches a portion of a path in the index. If so, we will use the existing path information. For example, when adding `foo/bar.c`, if there is an index entry to `FOO/other` and the filesystem is case insensitive, then we will put `bar.c` into the existing tree instead of creating a new one with a different case. Use `strncmp` to do that instead of `memcmp`. When we `bsearch` into the index, we locate the position where the new entry would go. The index entry at that position does not necessarily have a relation to the entry we're adding, so we cannot make assumptions and use `memcmp`. Instead, compare them as strings. When canonicalizing paths, we look for the first index entry that matches a given substring.