Log

Author Commit Date CI Message
Edward Thomson 9eb19381 2016-04-25T22:35:55 patch::parse: test diff with exact rename and copy
Edward Thomson 8a670dc4 2016-04-25T18:08:03 patch::parse: test diff with simple rename
Edward Thomson 38a347ea 2016-04-25T17:52:39 patch::parse: handle patches with no hunks Patches may have no hunks when there's no modifications (for example, in a rename). Handle them.
Edward Thomson e774d5af 2016-04-25T16:47:48 diff::parse tests: test parsing a diff Test that we can create a diff file, then parse the results and that the two are identical in-memory.
Edward Thomson 7166bb16 2016-04-25T00:35:48 introduce `git_diff_from_buffer` to parse diffs Parse diff files into a `git_diff` structure.
Edward Thomson 853e585f 2016-04-25T16:32:30 patch: zero id and abbrev length for empty files
Edward Thomson 33ae8762 2016-04-25T13:07:18 patch: identify non-binary patches as `NOT_BINARY`
Edward Thomson 72827490 2016-04-25T12:40:19 Introduce `git_diff_to_buf` Like `git_patch_to_buf`, provide a simple helper method that can print an entire diff directory to a `git_buf`.
Edward Thomson 94e488a0 2016-04-24T16:14:25 patch: differentiate not found and invalid patches
Edward Thomson 17572f67 2016-04-21T00:04:14 git_patch_parse_ctx: refcount the context
Edward Thomson 9be638ec 2016-04-19T15:12:18 git_diff_generated: abstract generated diffs
Edward Thomson aa4bfb32 2016-02-07T15:08:16 parse: introduce parse_ctx_contains_s
Edward Thomson 8d44f8b7 2015-11-24T15:19:59 patch: `patch_diff` -> `patch_generated`
Edward Thomson 53571f2f 2015-11-21T15:16:01 vector: more sensible names for `grow_at`/`shrink_at`
Edward Thomson 440e3bae 2015-11-21T12:27:03 patch: `git_patch_from_patchfile` -> `git_patch_from_buffer`
Edward Thomson 00e63b36 2015-11-21T12:37:01 patch: provide static string `advance_expected`
Edward Thomson a03952f0 2015-09-25T12:44:14 patch: formatting cleanups
Edward Thomson e564fc65 2015-09-25T12:41:15 git_vector_grow/shrink: correct shrink, and tests
Edward Thomson 0ff723cc 2015-09-25T12:09:50 apply: test postimages that grow/shrink original Test with some postimages that actually grow/shrink from the original, adding new lines or removing them. (Also do so without context to ensure that we can add/remove from a non-zero part of the line vector.)
Edward Thomson 8cb27223 2015-09-25T10:48:19 git_buf_quote/unquote: handle > \177 Parse values up to and including `\377` (`0xff`) when unquoting. Print octal values as an unsigned char when quoting, lest `printf` think we're talking about negatives.
Edward Thomson 0267c34c 2015-09-25T10:19:50 patch application: drop unnecessary `patch_image_init`
Edward Thomson 4117a235 2015-09-24T10:32:15 patch parse: dup the patch from the callers
Edward Thomson 6278fbc5 2015-09-24T09:40:42 patch parsing: squash some memory leaks
Edward Thomson f941f035 2015-09-24T09:25:10 patch: drop some warnings
Edward Thomson 040ec883 2015-09-23T18:20:17 patch: use strlen to mean string length `oid_strlen` has meant one more than the length of the string. This is mighty confusing. Make it mean only the string length! Whomsoever needs to allocate a buffer to hold a string can null terminate it like normal.
Edward Thomson e2cdc145 2015-09-23T17:48:52 patch: show modes when only the mode has changed
Edward Thomson 4ac2d8ac 2015-09-23T16:33:02 patch: quote filenames when necessary
Edward Thomson d3d95d5a 2015-09-23T16:30:48 git_buf_quote: quote ugly characters
Edward Thomson 72806f4c 2015-09-23T13:56:48 patch: don't print some headers on pure renames
Edward Thomson 82175084 2015-09-23T13:40:12 Introduce git_patch_options, handle prefixes Handle prefixes (in terms of number of path components) for patch parsing.
Edward Thomson 19e46645 2015-09-23T11:07:04 patch printing: include rename information
Edward Thomson d536ceac 2015-09-23T10:47:34 patch_parse: don't set new mode when deleted
Edward Thomson 28f70443 2015-09-23T10:38:51 patch_parse: use names from `diff --git` header When a text file is added or deleted, use the file names from the `diff --git` header instead of the `---` or `+++` lines. This is for compatibility with git.
Edward Thomson 1462c95a 2015-09-23T09:54:25 patch_parse: set binary flag We may have parsed binary data, set the `SHOW_BINARY` flag which indicates that we have actually computed a binary diff.
Edward Thomson 2f3b922f 2015-09-22T18:54:10 patch_parse: test roundtrip patch parsing -> print
Edward Thomson 42b34428 2015-09-22T18:54:10 patch_parse: ensure we can parse a patch
Edward Thomson bc6a31c9 2015-09-22T18:29:14 patch: when parsing, set nfiles correctly in delta
Edward Thomson d68cb736 2015-09-22T18:25:03 diff: include oid length in deltas Now that `git_diff_delta` data can be produced by reading patch file data, which may have an abbreviated oid, allow consumers to know that the id is abbreviated.
Edward Thomson e7ec327d 2015-09-22T17:56:42 patch parse: unset path prefix
Edward Thomson 8bca8b9e 2015-09-16T14:40:44 apply: move patch data to patch_common.h
Edward Thomson b85bd8ce 2015-09-16T11:37:03 patch: use delta's old_file/new_file members No need to replicate the old_file/new_file members, or plumb them strangely up.
Edward Thomson 804d5fe9 2015-09-11T08:37:12 patch: abstract patches into diff'ed and parsed Patches can now come from a variety of sources - either internally generated (from diffing two commits) or as the results of parsing some external data.
Edward Thomson 8d2eef27 2015-07-10T09:09:27 patch parsing: ensure empty patches are illegal
Edward Thomson 5d17d726 2015-07-09T19:22:28 patch parsing: parse binary patch files
Edward Thomson b8dc2fdb 2015-07-09T18:36:53 zstream: fail when asked to inflate garbage When we are provided some input buffer (with a length) to inflate, and it contains more data than simply the deflated data, fail. zlib will helpfully tell us when it is done reading (via Z_STREAM_END), so if there is data leftover in the input buffer, fail lest we continually try to inflate it.
Edward Thomson 5b78dbdb 2015-07-09T13:04:10 git_buf: decode base85 inputs
Edward Thomson 3149ff6f 2015-06-17T18:13:10 patch application: apply binary patches Handle the application of binary patches. Include tests that produce a binary patch (an in-memory `git_patch` object), then enusre that the patch applies correctly.
Edward Thomson b88f1713 2015-06-17T08:07:34 zstream: offer inflating, `git_zstream_inflatebuf` Introduce `git_zstream_inflatebuf` for simple uses.
Edward Thomson 1cd65991 2015-06-17T07:31:47 delta: refactor git_delta functions for consistency Refactor the git_delta functions to have consistent naming and parameters with the rest of the library.
Edward Thomson 6a2d2f8a 2015-06-17T06:42:20 delta: move delta application to delta.c Move the delta application functions into `delta.c`, next to the similar delta creation functions. Make the `git__delta_apply` functions adhere to other naming and parameter style within the library.
Edward Thomson 0004386f 2015-06-17T06:03:01 apply: handle empty patches When a patch is empty, simply copy the source into the destination.
Edward Thomson d34f6826 2014-04-08T17:18:47 Patch parsing from patch files
Edward Thomson 7cb904ba 2014-04-01T23:58:59 Introduce git_apply_patch The beginnings of patch application from an existing (diff-created) git_patch object: applies the hunks of a git_patch to a buffer.
Edward Thomson 784bb303 2016-05-26T10:28:00 Merge pull request #3799 from sschuberth/master Use AppVeyor's Start-FileDownload cmdlet
Edward Thomson e102daa4 2016-05-26T10:25:40 Merge pull request #3798 from mmuman/stat-test-fix test: Fix stat() test to mask out unwanted bits
Edward Thomson 06f42b62 2016-05-26T01:20:41 Merge branch 'checkout_submodules'
Jason Haslam c864b4ab 2016-05-12T13:18:07 Ignore submodules when checking for merge conflicts in the workdir.
Jason Haslam afab1fff 2016-02-16T21:02:41 checkout: handle dirty submodules correctly Don't generate conflicts when checking out a modified submodule and the submodule is dirty or modified in the workdir.
Edward Thomson fdf14637 2016-05-26T00:58:43 Merge pull request #3792 from edquist/misc Fix comment for GIT_FILEMODE_LINK
Sebastian Schuberth 247665ed 2016-05-25T12:10:44 Use AppVeyor's Start-FileDownload cmdlet Start-FileDownload maintains current directory context and allows specifying a request timeout, see [1]. [1] https://www.appveyor.com/docs/how-to/download-file#start-filedownload-cmdlet
François Revol 407f2e9f 2016-05-24T19:07:09 test: Fix stat() test to mask out unwanted bits Haiku and Hurd both pass extra bits in struct stat::st_mode.
Carlos Martín Nieto c756448c 2016-05-24T16:15:57 Merge pull request #3797 from libgit2/cmn/remove-single-entry tree: handle removal of all entries in the updater
Carlos Martín Nieto a2cb4713 2016-05-24T14:30:43 tree: handle removal of all entries in the updater When we remove all entries in a tree, we should remove that tree from its parent rather than include the empty tree.
Carlos Martín Nieto c91a1dc1 2016-05-23T18:02:24 Merge pull request #3794 from libgit2/cmn/tree-update-basename Tree updater fixups
Carlos Martín Nieto 53412305 2016-05-19T15:29:53 tree: plug leaks in the tree updater
Carlos Martín Nieto 6ee08d2c 2016-05-19T15:22:02 tree: use the basename for the entry removal When we want to remove the file, use the basename as the name of the entry to remove, instead of the full one, which includes the directories we've inserted into the stack.
Carlos Martín Nieto 92249656 2016-05-19T15:21:26 tree: use testrepo2 for the tree updater tests This gives us trees with subdirectories, which the new test needs.
Carl Edquist c8fb2e15 2016-05-18T16:00:01 Fix comment for GIT_FILEMODE_LINK 0120000 is symbolic link, not commit
Edward Thomson 1b56cda1 2016-05-18T11:30:02 Merge pull request #3770 from libgit2/cmn/tree-update Add a method specifically for modifying trees
Carlos Martín Nieto 9464f9eb 2016-05-02T17:36:58 Introduce a function to create a tree based on a different one Instead of going through the usual steps of reading a tree recursively into an index, modifying it and writing it back out as a tree, introduce a function to perform simple updates more efficiently. `git_tree_create_updated` avoids reading trees which are not modified and supports upsert and delete operations. It is not as versatile as modifying the index, but it makes some common operations much more efficient.
Edward Thomson c1485330 2016-05-09T08:58:44 Merge pull request #3767 from pks-t/pks/misc-fixes Misc fixes
Edward Thomson 6f02f198 2016-05-08T17:48:22 Merge pull request #3773 from lucasderraugh/patch-1 Fix unused variable 'message' warning
Carlos Martín Nieto 17a93afa 2016-05-06T18:44:37 Merge pull request #3757 from johnhaley81/jh/fix-create-initial-commit Fix `git_commit_create` for an initial commit
Lucas Derraugh 2527db87 2016-05-05T23:34:23 Fix unused variable 'message' warning
John Haley 5785ae9b 2016-05-04T11:14:17 Fix initial commit test `test_commit_commit__create_initial_commit_parent_not_current` was not correctly testing that `HEAD` was not changed. Now we grab the oid that it was pointing to before the call to `git_commit_create` and the oid that it's pointing to afterwards and compare those.
Carlos Martín Nieto 2e43a37b 2016-05-04T19:05:38 Merge pull request #3769 from libgit2/ethomson/rebase_inmemory_no_base Rebase: rebase a branch with no merge base for in-memory
John Haley 4f22ccb9 2016-05-03T13:32:22 Add tests for creating an initial commit
John Haley 225cb880 2016-04-26T08:09:04 Fix `git_commit_create` for an initial commit When calling `git_commit_create` with an empty array of `parents` and `parent_count == 0` the call will segfault at https://github.com/libgit2/libgit2/blob/master/src/commit.c#L107 when it's trying to compare `current_id` to a null parent oid. This just puts in a check to stop that segfault.
Edward Thomson 9a363d1b 2016-05-03T15:29:50 rebase: handle no common ancestor for inmemory
Edward Thomson c7b4bbff 2016-05-03T15:22:22 rebase: test rebase (merge) w/ no common ancestor
Patrick Steinhardt fe3057b4 2016-05-03T17:36:09 diff: simplify code for handling empty dirs When determining diffs between two iterators we may need to recurse into an unmatched directory for the "new" iterator when it is either a prefix to the current item of the "old" iterator or when untracked/ignored changes are requested by the user and the directory is untracked/ignored. When advancing into the directory and no files are found, we will get back `GIT_ENOTFOUND`. If so, we simply skip the directory, handling resulting unmatched old items in the next iteration. The other case of `iterator_advance_into` returning either `GIT_NOERROR` or any other error but `GIT_ENOTFOUND` will be handled by the caller, which will now either compare the first directory entry of the "new" iterator in case of `GIT_ENOERROR` or abort on other cases. Improve readability of the code to make the above logic more clear.
Edward Thomson 4d384d6b 2016-05-02T13:59:51 Merge pull request #3759 from libgit2/cmn/faster-header odb: avoid inflating the full delta to read the header
Patrick Steinhardt 153fde5b 2016-05-02T16:49:59 delta-apply: fix sign extension We compute offsets by executing `off |= (*delta++ << 24)` for multiple constants, where `off` is of type `size_t` and `delta` is of type `unsigned char`. The usual arithmetic conversions (see ISO C89 §3.2.1.5 "Usual arithmetic conversions") kick in here, causing us to promote both operands to `int` and then extending the result to an `unsigned long` when OR'ing it with `off`. The integer promotion to `int` may result in wrong size calculations for big values. Fix the issue by making the constants `unsigned long`, causing both operands to be promoted to `unsigned long`.
Patrick Steinhardt 7f407710 2016-05-02T16:24:14 odb_loose: fix undefined behavior when computing size An object's size is computed by reading the object header's size field until the most significant bit is not set anymore. To get the total size, we increase the shift on each iteration and add the shifted value to the total size. We read the current value into a variable of type `unsigned char`, from which we then take all bits except the most significant bit and shift the result. We will end up with a maximum shift of 60, but this exceeds the width of the value's type, resulting in undefined behavior. Fix the issue by instead reading the values into a variable of type `unsigned long`, which matches the required width. This is equivalent to git.git, which uses an `unsigned long` as well.
Patrick Steinhardt 7b24c4fd 2016-05-02T15:47:54 checkout: set ignorecase=0 when config lookup fails When `git_repository__cvar` fails we may end up with a `ignorecase` value of `-1`. As we subsequently check if `ignorecase` is non-zero, we may end up reporting that data should be removed when in fact it should not. Err on the safer side and set `ignorecase = 0` when `git_repository__cvar` fails.
Patrick Steinhardt fcd1b786 2016-05-02T14:46:14 merge_file: do not unnecessarily check ours/theirs for NULL The `merge_file__xdiff` function checks if either `ours` or `theirs` is `NULL`. The function is to be called with existing files, though, and in fact already unconditionally dereferences both pointers. Remove the unnecessary check to silence warnings.
Carlos Martín Nieto a97b769a 2016-04-27T12:00:31 odb: avoid inflating the full delta to read the header When we read the header, we want to know the size and type of the object. We're currently inflating the full delta in order to read the first few bytes. This can mean hundreds of kB needlessly inflated for large objects. Instead use a packfile stream to read just enough so we can read the two varints in the header and avoid inflating most of the delta.
Patrick Steinhardt f80852af 2016-05-02T14:30:14 index: fix memory leak on error case
Carlos Martín Nieto d24425fa 2016-04-29T18:34:03 Merge pull request #3764 from libgit2/ethomson/cmake_pc cmake: include threading libraries in pkg-config
Edward Thomson 097b0761 2016-04-29T10:18:04 cmake: include threading libraries in pkg-config Include any required threading libraries in our `libgit2.pc`.
Carlos Martín Nieto 5e8ba35d 2016-04-29T10:36:01 Merge pull request #3763 from libgit2/ethomson/signature_from_buffer Introduce `git_signature_from_buffer`
Edward Thomson 1e7fa834 2016-04-28T22:32:20 Merge pull request #3760 from backhub/bug/openssl_read Fix return value of openssl_read (infinite loop)
Edward Thomson d383c39b 2016-04-28T12:47:14 Introduce `git_signature_from_buffer` Allow users to construct a signature from the type of signature lines that actually appear in commits.
Christian Schlack 568c5a9f 2016-04-27T13:56:16 Fix style: no braces
Carlos Martín Nieto 88284dfb 2016-04-26T21:21:27 Merge pull request #3758 from libgit2/ethomson/annotated_commit_refs Annotated commits: differentiate between the ref names and the description
Edward Thomson d5592378 2016-04-26T11:39:53 annotated_commit: provide refs and description Differentiate between the ref_name used to create an annotated_commit (that can subsequently be used to look up the reference) and the description that we resolved this with (which _cannot_ be looked up). The description is used for things like reflogs (and may be a ref name, and ID something that we revparsed to get here), while the ref name must actually be a reference name, and is used for things like rebase to return to the initial branch.
Christian Schlack 4734c52a 2016-04-26T18:04:03 Fix return value of openssl_read (infinite loop) openssl_read should return -1 in case of error. SSL_read returns values <= 0 in case of error. A return value of 0 can lead to an infinite loop, so the return value of ssl_set_error will be returned if SSL_read is not successful (analog to openssl_write).
Edward Thomson b3ffd8f6 2016-04-26T11:48:11 rebase::abort: test we can abort rebase by revspec Test that we can properly abort a rebase when it is initialized by a revspec. This ensures that we do not conflate revspecs and refnames.
Carlos Martín Nieto cb2dfa46 2016-04-26T13:40:03 Merge pull request #3755 from arthurschreiber/patch-9 Remove traces of `git_blob_create_fromchunks`
Arthur Schreiber a3e379cb 2016-04-26T11:10:31 Remove traces of `git_blob_create_fromchunks`