- 20 Dec, 2017 1 commit
-
-
Introduce `git_prefixncmp` that will search up to the first `n` characters of a string to see if it is prefixed by another string. This is useful for examining if a non-null terminated character array is prefixed by a particular substring. Consolidate the various implementations of `git__prefixcmp` around a single core implementation and add some test cases to validate its behavior.
Edward Thomson committed
-
- 23 Oct, 2017 2 commits
-
-
Etienne Samson committed
-
Etienne Samson committed
-
- 26 Jun, 2017 1 commit
-
-
The upstream git project provides the ability to calculate a so-called patch ID. Quoting from git-patch-id(1): A "patch ID" is nothing but a sum of SHA-1 of the file diffs associated with a patch, with whitespace and line numbers ignored." Patch IDs can be used to identify two patches which are probably the same thing, e.g. when a patch has been cherry-picked to another branch. This commit implements a new function `git_diff_patchid`, which gets a patch and derives an OID from the diff. Note the different terminology here: a patch in libgit2 are the differences in a single file and a diff can contain multiple patches for different files. The implementation matches the upstream implementation and should derive the same OID for the same diff. In fact, some code has been directly derived from the upstream implementation. The upstream implementation has two different modes to calculate patch IDs, which is the stable and unstable mode. The old way of calculating the patch IDs was unstable in a sense that a different ordering the diffs was leading to different results. This oversight was fixed in git 1.9, but as git tries hard to never break existing workflows, the old and unstable way is still default. The newer and stable way does not care for ordering of the diff hunks, and in fact it is the mode that should probably be used today. So right now, we only implement the stable way of generating the patch ID.
Patrick Steinhardt committed
-
- 13 Jun, 2017 2 commits
-
-
Mohseen Mukaddam committed
-
Initialization of the `git_proxy_options` structure is never tested anywhere. Include it in our usual initialization test in "core::structinit::compare".
Patrick Steinhardt committed
-
- 06 Jun, 2017 1 commit
-
-
When encoding varints to a buffer, we want to remain sure that the required buffer space does not exceed what is actually available. Our current check does not do the right thing, though, in that it does not honor that our `pos` variable counts the position down instead of up. As such, we will require too much memory for small varints and not enough memory for big varints. Fix the issue by correctly calculating the required size as `(sizeof(varint) - pos)`. Add a test which failed before.
Patrick Steinhardt committed
-
- 25 Apr, 2017 1 commit
-
-
Patrick Steinhardt committed
-
- 22 Mar, 2017 1 commit
-
-
Address family 5 might exist on some crazy system like Haiku. Use `INT_MAX-1` as an unsupported address family.
Edward Thomson committed
-
- 20 Mar, 2017 1 commit
-
-
Patrick Steinhardt committed
-
- 03 Mar, 2017 1 commit
-
-
Edward Thomson committed
-
- 25 Feb, 2017 1 commit
-
-
Haiku will assert in a nightly build if the "dst" input to inet_pton() is NULL.
Kevin Wojniak committed
-
- 17 Feb, 2017 8 commits
-
-
Patrick Steinhardt committed
-
Patrick Steinhardt committed
-
Patrick Steinhardt committed
-
Patrick Steinhardt committed
-
Patrick Steinhardt committed
-
Patrick Steinhardt committed
-
Patrick Steinhardt committed
-
Patrick Steinhardt committed
-
- 08 Feb, 2017 2 commits
-
-
When calling `git_path_dirname_r` on a Win32 prefix, e.g. a drive or network share prefix, we always want to return the trailing '/'. This does not work currently when passing in a path like 'C:', where the '/' would not be appended correctly. Fix this by appending a '/' if we try to normalize a Win32 prefix and there is no trailing '/'.
Patrick Steinhardt committed -
Getting the dirname of a filesystem root should return the filesystem root itself. E.g. the dirname of "/" is always "/". On Windows, we emulate this behavior and as such, we should return e.g. "C:/" if calling dirname on "C:/". But we currently fail to do so and instead return ".", as we do not check if we actually have a Windows prefix before stripping off the last directory component. Fix this by calling out to `win32_prefix_length` immediately after stripping trailing slashes, returning early if we have a prefix.
Patrick Steinhardt committed
-
- 18 Dec, 2016 1 commit
-
-
When given $PATH as part of a search path, we guess again instead of substituting what the user already set.
Carlos Martín Nieto committed
-
- 18 Nov, 2016 1 commit
-
-
We want a predictable number of initializations in our multithreaded init test, but we also want to make sure that we have _actually_ initialized `git_libgit2_init` before calling `git_thread_create` (since it now has a sanity check that `git_libgit2_init` has been called). Since `git_thread_create` is internal-only, keep this sanity check. Flip the invocation so that we `git_libgit2_init` before our thread tests and `git_libgit2_shutdown` again after.
Edward Thomson committed
-
- 02 Nov, 2016 1 commit
-
-
Exercise the logic surrounding deinitialization of the libgit2 library as well as repeated concurrent de- and reinitialization. This tries to catch races and makes sure that it is possible to reinitialize libgit2 multiple times. After deinitializing libgit2, we have to make sure to setup options required for testing. Currently, this only includes setting up the configuration search path again. Before, this has been set up once in `tests/main.c`.
Patrick Steinhardt committed
-
- 28 Oct, 2016 1 commit
-
-
The `git_pqueue` struct allows being fixed in its total number of entries. In this case, we simply throw away items that are inserted into the priority queue by examining wether the new item to be inserted has a higher priority than the previous smallest one. This feature somewhat contradicts our pqueue implementation in that it is allowed to not have a comparison function. In fact, we also fail to check if the comparison function is actually set in the case where we add a new item into a fully filled fixed-size pqueue. As we cannot determine which item is the smallest item in absence of a comparison function, we fix the `NULL` pointer dereference by simply dropping all new items which are about to be inserted into a full fixed-size pqueue.
Patrick Steinhardt committed
-
- 27 Oct, 2016 1 commit
-
-
Patrick Steinhardt committed
-
- 07 Oct, 2016 1 commit
-
-
`xlocale.h` only defines `regcomp_l` if `regex.h` was included as well. Also change the test cases to actually test `p_regcomp` works with a multibyte locale.
Arthur Schreiber committed
-
- 06 Oct, 2016 2 commits
-
-
Arthur Schreiber committed
-
This is a convenience function to reverse the contents of a vector and a pqueue in-place. The pqueue function is useful in the case where we're treating it as a LIFO queue.
Carlos Martín Nieto committed
-
- 10 Aug, 2016 1 commit
-
-
This code is ported from git.git Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: David Turner <dturner@twopensource.com>
David Turner committed
-
- 06 Jul, 2016 1 commit
-
-
wildart committed
-
- 05 Jul, 2016 1 commit
-
-
Andrius Bentkus committed
-
- 29 Jun, 2016 1 commit
-
-
Krishna Ram Prakash R committed
-
- 26 May, 2016 6 commits
-
-
Edward Thomson committed
-
Edward Thomson committed
-
Edward Thomson committed
-
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 committed -
Edward Thomson committed
-
Introduce `git_zstream_inflatebuf` for simple uses.
Edward Thomson committed
-