Log

Author Commit Date CI Message
Arthur Schreiber ab96ca55 2016-10-06T13:15:31 Make sure we use the `C` locale for `regcomp` on macOS.
Carlos Martín Nieto e8ab13b3 2016-10-05T23:46:02 Merge pull request #3954 from libgit2/cmn/osx-ssh-key Travis Mac SSH key issues
Carlos Martín Nieto db357667 2016-10-05T20:17:06 travis: take the newer ssh-keygen format into account The Mac machines have updated their SSH version and so the ssh-keygen format has changed. Ask it for MD5, which is the one that is output as hex.
Carlos Martín Nieto 94d565b9 2016-10-05T18:52:43 cibuild: set -x This lets us see the details of what we're doing instead of just seeing the output of unknown commands in the build output.
Edward Thomson 9fbbb0ee 2016-10-01T19:32:16 Merge pull request #3931 from libgit2/ethomson/checkout_dont_calculate_oid_for_dirs checkout: don't try to calculate oid for directories
Edward Thomson 955c99c2 2016-09-14T10:28:24 checkout: don't try to calculate oid for directories When trying to determine if we can safely overwrite an existing workdir item, we may need to calculate the oid for the workdir item to determine if its identical to the old side (and eligible for removal). We previously did this regardless of the type of entry in the workdir; if it was a directory, we would open(2) it and then try to read(2). The read(2) of a directory fails on many platforms, so we would treat it as if it were unmodified and continue to perform the checkout. On FreeBSD, you _can_ read(2) a directory, so this pattern failed. We would calculate an oid from the data read and determine that the directory was modified and would therefore generate a checkout conflict. This reliance on read(2) is silly (and was most likely accidentally giving us the behavior we wanted), we should be explicit about the directory test.
Edward Thomson 89c332e4 2016-09-13T16:16:20 Merge pull request #3929 from libgit2/vmg/time time: Export `git_time_monotonic`
Vicent Marti 2749ff46 2016-09-13T15:52:43 time: Export `git_time_monotonic`
Patrick Steinhardt bba704ad 2016-09-09T08:45:33 Merge pull request #3925 from pks-t/pks/cmake-library-dirs cmake: add curl library path
Edward Thomson 9ad07fc0 2016-09-06T10:43:21 Merge pull request #3923 from libgit2/ethomson/diff-read-empty-binary Read binary patches (with no binary data)
Patrick Steinhardt 46035d98 2016-09-06T11:21:29 Merge pull request #3882 from pks-t/pks/fix-fetch-refspec-dst-parsing refspec: do not set empty rhs for fetch refspecs
Edward Thomson adedac5a 2016-09-02T02:03:45 diff: treat binary patches with no data special When creating and printing diffs, deal with binary deltas that have binary data specially, versus diffs that have a binary file but lack the actual binary data.
Patrick Steinhardt 528b2f7d 2016-09-05T13:24:07 cmake: add curl library path The `PKG_CHECK_MODULES` function searches a pkg-config module and then proceeds to set various variables containing information on how to link to the library. In contrast to the `FIND_PACKAGE` function, the library path set by `PKG_CHECK_MODULES` will not necessarily contain linking instructions with a complete path to the library, though. So when a library is not installed in a standard location, the linker might later fail due to being unable to locate it. While we already honor this when configuring libssh2 by adding `LIBSSH2_LIBRARY_DIRS` to the link directories, we fail to do so for libcurl, preventing us to build libgit2 on e.g. FreeBSD. Fix the issue by adding the curl library directory to the linker search path.
Edward Thomson f4e3dae7 2016-09-02T11:26:16 diff_print: change test for skipping binary printing Instead of skipping printing a binary diff when there is no data, skip printing when we have a status of `UNMODIFIED`. This is more in-line with our internal data model and allows us to expand the notion of binary data. In the future, there may have no data because the files were unmodified (there was no data to produce) or it may have no data because there was no data given to us in a patch. We want to treat these cases separately.
Edward Thomson 4bfd7c63 2016-09-01T16:55:27 patch: error on diff callback failure
Edward Thomson ce54e77c 2016-09-02T08:50:08 Merge pull request #3922 from pks-t/pks/diff-only-load-binaries-when-requested patch_generate: only calculate binary diffs if requested
Patrick Steinhardt 4b34f687 2016-09-01T15:14:25 patch_generate: only calculate binary diffs if requested When generating diffs for binary files, we load and decompress the blobs in order to generate the actual diff, which can be very costly. While we cannot avoid this for the case when we are called with the `GIT_DIFF_SHOW_BINARY` flag, we do not have to load the blobs in the case where this flag is not set, as the caller is expected to have no interest in the actual content of binary files. Fix the issue by only generating a binary diff when the caller is actually interested in the diff. As libgit2 uses heuristics to determine that a blob contains binary data by inspecting its size without loading from the ODB, this saves us quite some time when diffing in a repository with binary files.
Carlos Martín Nieto 40b08124 2016-08-30T12:11:02 Merge pull request #3915 from pks-t/pks/index-collision-test-leak tests: index: do not re-allocate index
Patrick Steinhardt a08e8825 2016-08-30T08:22:17 Merge pull request #3907 from steffhip/git_checkout_tree-fix
Stefan Huber 88cfe614 2016-08-24T01:20:39 git_checkout_tree options fix According to the reference the git_checkout_tree and git_checkout_head functions should accept NULL in the opts field This was broken since the opts field was dereferenced and thus lead to a crash.
Edward Thomson dfd79576 2016-08-29T09:39:03 Merge pull request #3914 from pks-t/pks/libqgit2-binding-url README: adjust URL to libqgit2 repository
Patrick Steinhardt 86e88534 2016-08-29T13:09:58 tests: index: do not re-allocate index Plug a memory leak caused by re-allocating a `git_index` structure which has already been allocated by the test suite's initializer.
Patrick Steinhardt 8044ee42 2016-08-29T09:38:20 README: adjust URL to libqgit2 repository
Patrick Steinhardt ace0d36b 2016-08-29T09:29:34 Merge pull request #3900 from pks-t/pks/http-close-substream-on-connect transports: http: set substream as disconnected after closing
Edward Thomson 5671e81f 2016-08-26T10:09:12 Merge pull request #3908 from libgit2/ethomson/patch_from_diff Teach `git_patch_from_diff` about parsed diffs
Edward Thomson b859faa6 2016-08-23T23:38:39 Teach `git_patch_from_diff` about parsed diffs Ensure that `git_patch_from_diff` can return the patch for parsed diffs, not just generate a patch for a generated diff.
Patrick Steinhardt c60210d3 2016-08-24T08:28:49 Merge pull request #3904 from stinb/filesystem-iterator-double-free filesystem_iterator: fixed double free on error
Jason Haslam 7a3f1de5 2016-08-22T09:27:47 filesystem_iterator: fixed double free on error
Edward Thomson c1b370e9 2016-08-17T09:24:44 Merge pull request #3837 from novalis/dturner/indexv4 Support index v4
Edward Thomson 635a9222 2016-08-17T08:54:48 Merge pull request #3895 from pks-t/pks/negate-basename-in-subdirs ignore: allow unignoring basenames in subdirectories
Patrick Steinhardt b1453601 2016-08-17T11:38:26 transports: http: reset `connected` flag when closing transport
Patrick Steinhardt c4cba4e9 2016-08-17T11:00:05 transports: http: reset `connected` flag when re-connecting transport When calling `http_connect` on a subtransport whose stream is already connected, we first close the stream in case no keep-alive is in use. When doing so, we do not reset the transport's connection state, though. Usually, this will do no harm in case the subsequent connect will succeed. But when the connection fails we are left with a substransport which is tagged as connected but which has no valid stream attached. Fix the issue by resetting the subtransport's connected-state when closing its stream in `http_connect`.
Patrick Steinhardt fcb2c1c8 2016-08-12T09:06:15 ignore: allow unignoring basenames in subdirectories The .gitignore file allows for patterns which unignore previous ignore patterns. When unignoring a previous pattern, there are basically three cases how this is matched when no globbing is used: 1. when a previous file has been ignored, it can be unignored by using its exact name, e.g. foo/bar !foo/bar 2. when a file in a subdirectory has been ignored, it can be unignored by using its basename, e.g. foo/bar !bar 3. when all files with a basename are ignored, a specific file can be unignored again by specifying its path in a subdirectory, e.g. bar !foo/bar The first problem in libgit2 is that we did not correctly treat the second case. While we verified that the negative pattern matches the tail of the positive one, we did not verify if it only matches the basename of the positive pattern. So e.g. we would have also negated a pattern like foo/fruz_bar !bar Furthermore, we did not check for the third case, where a basename is being unignored in a certain subdirectory again. Both issues are fixed with this commit.
David Turner 5625d86b 2016-05-17T15:40:32 index: support index v4 Support reading and writing index v4. Index v4 uses a very simple compression scheme for pathnames, but is otherwise similar to index v3. Signed-off-by: David Turner <dturner@twitter.com>
David Turner aeb5ee5a 2016-05-17T15:40:46 varint: Add varint encoding/decoding This code is ported from git.git Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: David Turner <dturner@twopensource.com>
Carlos Martín Nieto 26a8617d 2016-08-09T14:34:55 Merge pull request #3891 from pks-t/pks/stransport-memory-management-improvements stransport memory management improvements
Edward Thomson 5961face 2016-08-09T08:07:10 Merge pull request #3893 from pks-t/pks/remove-unused-test-cb tests: blob: remove unused callback function
Patrick Steinhardt 4006455f 2016-08-09T10:09:23 tests: blob: remove unused callback function
Patrick Steinhardt b9895144 2016-08-08T14:47:32 stransport: do not use `git_stream_free` on uninitialized stransport When failing to initialize a new stransport stream, we try to release already allocated memory by calling out to `git_stream_free`, which in turn called out to the stream's `free` function pointer. As we only initialize the function pointer later on, this leads to a `NULL` pointer exception. Furthermore, plug another memory leak when failing to create the SSL context.
Carlos Martín Nieto 97e57e87 2016-08-08T15:13:59 Merge pull request #3887 from libgit2/ethomson/empty_blob odb: only provide the empty tree
Edward Thomson b47e79e2 2016-08-08T08:42:32 Merge pull request #3890 from pks-t/pks/stransport-static-linkage stransport: make internal functions static
Patrick Steinhardt 067bf5dc 2016-08-08T13:49:17 stransport: make internal functions static
Carlos Martín Nieto 0fd5a44d 2016-08-08T13:12:51 Merge pull request #3888 from libgit2/ethomson/doc_diff_from_buffer diff: document `git_diff_from_buffer`
Edward Thomson 9bc8c80f 2016-08-05T20:34:19 odb: actually insert the empty blob in tests
Edward Thomson e2e7f31a 2016-08-05T20:00:22 diff: document `git_diff_from_buffer`
Edward Thomson becadafc 2016-08-05T19:30:56 odb: only provide the empty tree Only provide the empty tree internally, which matches git's behavior. If we provide the empty blob then any users trying to write it with libgit2 would omit it from actually landing in the odb, which appear to git proper as a broken repository (missing that object).
Edward Thomson 56bbdf93 2016-08-05T14:23:29 Merge pull request #3886 from libgit2/cmn/copypeertrust-null SecureTransport: handle NULL trust on success
Carlos Martín Nieto 9884dd61 2016-08-05T18:40:37 SecureTransport: handle NULL trust on success The `SSLCopyPeerTrust` call can succeed but fail to return a trust object if it can't load the certificate chain and thus cannot check the validity of a certificate. This can lead to us calling `CFRelease` on a `NULL` trust object, causing a crash. Handle this by returning ECERTIFICATE.
Carlos Martín Nieto c550c922 2016-08-05T18:24:28 Merge pull request #3881 from pks-t/pks/fix-clar-suite-prefix-computation clar: fix parsing of test suite prefixes
Edward Thomson cba60b9b 2016-08-05T09:10:58 Merge pull request #3884 from pks-t/pks/patch-image-initialization Patch image initialization
Patrick Steinhardt 274a727e 2016-08-05T10:57:42 apply: fix warning when initializing patch images
Patrick Steinhardt 844f5b20 2016-08-05T10:57:13 pool: provide macro to statically initialize git_pool
Edward Thomson 73dab769 2016-08-04T16:16:16 Merge pull request #3861 from libgit2/ethomson/refresh_objects odb: freshen existing objects when writing
Edward Thomson 27051d4e 2016-07-22T13:34:19 odb: only freshen pack files every 2 seconds Since writing multiple objects may all already exist in a single packfile, avoid freshening that packfile repeatedly in a tight loop. Instead, only freshen pack files every 2 seconds.
Edward Thomson 8f09a98e 2016-07-14T16:23:24 odb: freshen existing objects when writing When writing an object, we calculate its OID and see if it exists in the object database. If it does, we need to freshen the file that contains it.
Carlos Martín Nieto d2794b0e 2016-08-04T20:49:50 Merge pull request #3877 from libgit2/ethomson/paths_init sysdir: don't assume an empty dir is uninitialized
Edward Thomson 0d84de02 2016-08-04T13:20:49 Merge pull request #3869 from richardipsum/fix-outdated-comment Fix outdated comment
Edward Thomson 78b500bf 2016-08-04T12:45:19 Merge pull request #3850 from wildart/custom-tls Enable https transport for custom TLS streams
Edward Thomson 031d34b7 2016-07-29T12:59:42 sysdir: use the standard `init` pattern Don't try to determine when sysdirs are uninitialized. Instead, simply initialize them all at `git_libgit2_init` time and never try to reinitialize, except when consumers explicitly call `git_sysdir_set`. Looking at the buffer length is especially problematic, since there may no appropriate path for that value. (For example, the Windows-specific programdata directory has no value on non-Windows machines.) Previously we would continually trying to re-lookup these values, which could get racy if two different threads are each calling `git_sysdir_get` and trying to lookup / clear the value simultaneously.
Edward Thomson da7f9feb 2016-08-04T11:51:06 Merge pull request #3879 from libgit2/ethomson/mwindow_init mwindow: init mwindow files in git_libgit2_init
Edward Thomson 2381d9e4 2016-08-03T17:01:48 mwindow: init mwindow files in git_libgit2_init
Patrick Steinhardt 1eee631d 2016-08-04T13:45:28 refspec: do not set empty rhs for fetch refspecs According to git-fetch(1), "[t]he colon can be omitted when <dst> is empty." So according to git, the refspec "refs/heads/master" is the same as the refspec "refs/heads/master:" when fetching changes. When trying to fetch from a remote with a trailing colon with libgit2, though, the fetch actually fails while it works when the trailing colon is left out. So obviously, libgit2 does _not_ treat these two refspec formats the same for fetches. The problem results from parsing refspecs, where the resulting refspec has its destination set to an empty string in the case of a trailing colon and to a `NULL` pointer in the case of no trailing colon. When passing this to our DWIM machinery, the empty string gets translated to "refs/heads/", which is simply wrong. Fix the problem by having the parsing machinery treat both cases the same for fetch refspecs.
Patrick Steinhardt f2cab0a6 2016-08-04T11:49:39 clar: fix parsing of test suite prefixes When passing in a specific suite which should be executed by clar via `-stest::suite`, we try to parse this string and then include all tests contained in this suite. This also includes all tests in sub-suites, e.g. 'test::suite::foo'. In the case where multiple suites start with the same _string_, for example 'test::foo' and 'test::foobar', we fail to distinguish this correctly. When passing in `-stest::foobar`, we wrongly determine that 'test::foo' is a prefix and try to execute all of its matching functions. But as no function will now match 'test::foobar', we simply execute nothing. To fix this, we instead have to check if the prefix is an actual suite prefix as opposed to a simple string prefix. We do so by by inspecting if the first two characters trailing the prefix are our suite delimiters '::', and only consider the filter as matching in this case.
Edward Thomson baa87dfc 2016-08-03T22:00:21 Merge pull request #3880 from libgit2/ethomson/diff_file git_diff_file: move `id_abbrev`
Edward Thomson 002c8e29 2016-08-03T17:09:41 git_diff_file: move `id_abbrev` Move `id_abbrev` to a more reasonable place where it packs more nicely (before anybody starts using it).
Edward Thomson 152efee2 2016-08-02T18:43:12 Merge pull request #3865 from libgit2/ethomson/leaks Fix leaks, some warnings and an error
Edward Thomson df87648a 2016-07-24T16:10:30 crlf: set a safe crlf default
Edward Thomson a37624ec 2016-07-24T16:05:17 Merge pull request #3815 from pks-t/pks/coverity-model Coverity user model
Edward Thomson 76cfdd46 2016-07-24T15:51:13 Merge pull request #3862 from novalis/dturner/do-not-die-on-missing-config remote: Handle missing config values when deleting a remote
Edward Thomson b118f647 2016-07-22T14:02:00 repository: don't cast to `int` for no reason And give it a default so that some compilers don't (unnecessarily) complain.
Edward Thomson 4aaae935 2016-07-22T12:53:13 index: cast to avoid warning
Edward Thomson 498d0801 2016-07-22T12:01:24 tests: use a `size_t`
Edward Thomson 60e15ecd 2016-07-15T17:18:39 packbuilder: `size_t` all the things After 1cd65991, we were passing a pointer to an `unsigned long` to a function that now expected a pointer to a `size_t`. These types differ on 64-bit Windows, which means that we trash the stack. Use `size_t`s in the packbuilder to avoid this.
Edward Thomson 581a4d39 2016-07-14T23:32:35 apply: safety check files that dont end with eol
Edward Thomson c065f6a1 2016-07-14T23:04:47 apply: check allocation properly
Edward Thomson 531be3e8 2016-07-14T22:59:37 apply: compare preimage to image Compare the preimage to the image; don't compare the preimage to itself.
Edward Thomson e02f5676 2016-07-15T12:43:57 repo::open: remove dead code, free buffers
Edward Thomson 378d12ac 2016-07-24T15:47:58 Merge pull request #3868 from libgit2/ethomson/mac_build ci: point to the homebrew libssh2 install
Edward Thomson 0239eff3 2016-07-24T14:51:28 ci: install homebrew's curl on mac
Richard Ipsum 8b2ad593 2016-07-23T11:55:43 Make comment conform to style guide Style guide says // style comments should be avoided.
Richard Ipsum 877282ea 2016-07-23T11:47:59 Fix outdated comment SSH transport seems to be supported now.
Edward Thomson 08556e6d 2016-07-22T17:45:03 ci: install homebrew's zlib on mac
David Turner d81cb2e4 2016-07-15T13:32:23 remote: Handle missing config values when deleting a remote Somehow I ended up with the following in my ~/.gitconfig: [branch "master"] remote = origin merge = master rebase = true I assume something went crazy while I was running the git.git tests some time ago, and that I never noticed until now. This is not a good configuration, but it shouldn't cause problems. But it does. Specifically, if you have this in your config, and you perform the following set of actions: create a remote fetch from that remote create a branch off of the remote master branch called "master" delete the branch delete the remote The remote delete fails with the message "Could not find key 'branch.master.rebase' to delete". This is because it's iterating over the config entries (including the ones in the global config) and believes that there is a master branch which must therefore have these config keys. https://github.com/libgit2/libgit2/issues/3856
wildart bdec62dc 2016-07-06T13:06:25 remove conditions that prevent use of custom TLS stream
Edward Thomson c18a2bc4 2016-07-05T15:51:01 Merge pull request #3851 from txdv/get-user-agent Add get user agent functionality.
Edward Thomson b57c176a 2016-07-05T12:46:27 Merge pull request #3846 from rkrp/fix_bug_parsing_int64min Fixed bug while parsing INT64_MIN
Andrius Bentkus f1dba144 2016-07-05T09:41:51 Add get user agent functionality.
Edward Thomson d8243465 2016-07-01T18:47:06 Merge pull request #3836 from joshtriplett/cleanup-find_repo find_repo: Clean up and simplify logic
Edward Thomson ebeb56f0 2016-07-01T18:45:10 Merge pull request #3711 from joshtriplett/git_repository_discover_default Add GIT_REPOSITORY_OPEN_FROM_ENV flag to respect $GIT_* environment vars
Josh Triplett 2b80260e 2016-06-30T08:08:36 CHANGELOG.md: Document new flags for git_repository_open_ext Document GIT_REPOSITORY_OPEN_NO_DOTGIT and GIT_REPOSITORY_OPEN_FROM_ENV.
Josh Triplett 04d6ab6c 2016-06-30T08:08:06 CHANGELOG.md: Document behavior change in repository discovery
Edward Thomson e4218450 2016-06-30T10:20:32 Merge pull request #3847 from libgit2/ethomson/read_index_conflicts Include conflicts in `git_index_read_index`
Edward Thomson 6249d960 2016-06-29T17:55:44 index: include conflicts in `git_index_read_index` Ensure that we include conflicts when calling `git_index_read_index`, which will remove conflicts in the index that do not exist in the new target, and will add conflicts from the new target.
Edward Thomson 6f7ec728 2016-06-29T17:01:47 index: refactor common `read_index` functionality Most of `git_index_read_index` is common to reading any iterator. Refactor it out in case we want to implement `read_tree` in terms of it in the future.
Edward Thomson 59a0005d 2016-06-29T10:01:26 Merge pull request #3813 from stinb/submodule-update-fetch submodule: Try to fetch when update fails to find the target commit.
Edward Thomson d88e5001 2016-06-29T09:35:56 Merge pull request #3842 from pks-t/pks/double-free blame: increment reference count for origin's commit
Patrick Steinhardt 21766702 2016-06-27T15:20:20 blame: do not decrement commit refcount in make_origin When we create a blame origin, we try to look up the blob that is to be blamed at a certain revision. When this lookup fails, e.g. because the file did not exist at that certain revision, we fail to create the blame origin and return `NULL`. The blame origin that we have just allocated is thereby free'd with `origin_decref`. The `origin_decref` function does not only decrement reference counts for the blame origin, though, but also for its commit and blob. When this is done in the error case, we will cause an uneven reference count for these objects. This may result in hard-to-debug failures at seemingly unrelated code paths, where we try to access these objects when they in fact have already been free'd. Fix the issue by refactoring `make_origin` such that we only allocate the object after the only function that may fail so that we do not have to call `origin_decref` at all. Also fix the `pass_blame` function, which indirectly calls `make_origin`, to free the commit when `make_origin` failed.
Krishna Ram Prakash R 70b9b841 2016-06-28T20:19:52 Fixed bug while parsing INT64_MIN
Jason Haslam de43efcf 2016-06-28T16:07:25 submodule: Try to fetch when update fails to find the target commit in the submodule.
Edward Thomson 20302aa4 2016-06-25T23:33:05 Merge pull request #3223 from ethomson/apply Reading patch files