- 05 Apr, 2017 1 commit
-
-
Our libgit2.pc.in file is quoting the `libdir` variable in our declared "Libs:" line. The intention is to handle whitespaces here, but pkgconfig already does so by automatically escaping whitespace with backslashes. The correct thing to do is to instead quote the prefix, as this is the one which is being substituted by CMake upon installation. As both libdir and includedir will be expanded to "${prefix}/lib" and "${prefix}/include", respectively, pkgconfig will also correctly escape whitespaces. Note that this will actually break when a user manually wants to override libdir and includedir with a path containing whitespace. But actually, this cannot be helped, as always quoting these variables will actuall break the common case of being prefixed with "${prefix}". So we just bail out here and declare this as unsupported out of the box.
Patrick Steinhardt committed
-
- 28 Mar, 2017 5 commits
-
-
git_treebuilder_write_with_buffer refactorings
Edward Thomson committed -
While writing the tree inside of a buffer, we check whether the buffer runs out of memory after each tree entry. While we set the error code as soon as we detect the OOM situation, we happily proceed iterating over the entries. This is not useful at all, as we will try to write into the buffer repeatedly, which cannot work. Fix this by exiting as soon as we are OOM.
Patrick Steinhardt committed -
The `git_tree_entry *entry` variable is defined twice inside of this function. While this is not a problem currently, remove the shadowing variable to avoid future confusion.
Patrick Steinhardt committed -
While we detect errors in `git_treebuilder_write_with_buffer`, we just exit directly instead of freeing allocated memory. Fix this by remembering error codes and skipping forward to the function's cleanup code.
Patrick Steinhardt committed -
Fix memory leaks
Patrick Steinhardt committed
-
- 24 Mar, 2017 3 commits
-
-
Patrick Steinhardt committed
-
The recent addition of an error code to `pass_whole_blame` in ff8d2eb1 (blame_git: check return value of object lookup, 2017-03-20) introduced a spurious goto. Remove it.
Patrick Steinhardt committed -
git_futils: don't O_EXCL and O_TRUNC
Patrick Steinhardt committed
-
- 23 Mar, 2017 6 commits
-
-
sha1dc: perf improvements from upstream
Carlos Martín Nieto committed -
Edward Thomson committed
-
Edward Thomson committed
-
Edward Thomson committed
-
inet_pton: don't assume addr families don't exist
Edward Thomson committed -
Update SHA-1 collision detection code (cr-marcstevens/sha1collisiondetection) to master to include performance improvements.
Edward Thomson committed
-
- 22 Mar, 2017 6 commits
-
-
Worktree fixes
Edward Thomson committed -
fsync all the things
Edward Thomson committed -
Coverity fixes
Edward Thomson committed -
Fix the documentation for git_cred_acquire_cb
Edward Thomson committed -
Address family 5 might exist on some crazy system like Haiku. Use `INT_MAX-1` as an unsupported address family.
Edward Thomson committed -
`O_EXCL` and `O_TRUNC` are mutually exclusive flags to open(2); you can't truncate a file if you're asserting that it can't exist in the first place. Drop `O_TRUNC`.
Edward Thomson committed
-
- 21 Mar, 2017 7 commits
-
-
git_cred_acquire_cb isn't using the standard @param and @return tags. This is causing the generated documentation to not be formatted properly.
Remy Suen committed -
Patrick Steinhardt committed
-
While parsing patch header lines, we iterate over each line and check if the line has trailing garbage. What we do not check though is that the line is actually a line ending with a trailing newline. Fix this by checking the return code of `parse_advance_expected_str`.
Patrick Steinhardt committed -
The `pack_entry_find_prefix` function receives a `git_rawobj` structure as argument. While the function first initializes the structure to a sensible state, Coverity is unable to correctly detect this, resulting in a warning. Fix this warning by initializing the object to all-zeroes before passing it to the function.
Patrick Steinhardt committed -
While parsing section headers, we use a buffer to store the actual section name. We do not check though if the buffer runs out of memory at any stage. Do so.
Patrick Steinhardt committed -
The function `pass_whole_blame` performs an object lookup but does not check if the lookup actually succeeds. Convert the function to return an error code and check for it in the calling function.
Patrick Steinhardt committed -
README: Mention how to run tests
Edward Thomson committed
-
- 20 Mar, 2017 11 commits
-
-
Fix typo in remote.h API
Patrick Steinhardt committed -
Remy Suen committed
-
The OpenSSL library may require multiple locks to work correctly, where it is the caller's responsibility to initialize and release the locks. While we correctly initialized up to `n` locks, as determined by `CRYPTO_num_locks`, we were repeatedly freeing the same mutex in our shutdown procedure. Fix the issue by freeing locks at the correct index.
Patrick Steinhardt committed -
Remove `map_free` macros
Edward Thomson committed -
Patrick Steinhardt committed
-
Patrick Steinhardt committed
-
The symlink destination is always concatenated to the original path. Fix this by using `git_buf_sets` instead of `git_buf_puts`.
Sven Strickroth2 committed -
Diff fixes
Patrick Steinhardt committed -
merge_driver: fix const-correctness for source getters
Patrick Steinhardt committed -
The `map_free` functions were not implemented as functions but instead as macros which also set the map to NULL. While this is most certainly sensible in most cases, we should prefer the more obvious behavior, namingly leaving the map pointer intact. Furthermore, this macro has been refactored incorrectly during the map-refactorings: the two statements are not actually grouped together by a `do { ... } while (0)` block, as it is required for macros to match the behavior of functions more closely. This has led to at least one subtle nesting error in `pack-objects.c`. The following code block ``` if (pb->object_ix) git_oidmap_free(pb->object_ix); ``` would be expanded to ``` if (pb->object_ix) git_oidmap__free(pb->object_ix); pb->object_ix = NULL; ``` which is not what one woudl expect. While it is not a bug here as it would simply become a no-op, the wrong implementation could lead to bugs in other occasions. Fix this by simply removing the macro altogether and replacing it with real function calls. This leaves the burden of setting the pointer to NULL afterwards to the caller, but this is actually expected and behaves like other `free` functions.
Patrick Steinhardt committed -
We currently call `git_strmap_free` on `checkout_data.mkdir_map` in the `checkout_data_clear` function. The only thing protecting us from a double-free is that the `git_strmap_free` function is in fact not a function, but a macro that also sets the map to NULL. Remove the second call to `git_strmap_free` and explicitly set the map member to NULL.
Patrick Steinhardt committed
-
- 17 Mar, 2017 1 commit
-
-
It is possible to specify submodule URLs relative to the repository location. E.g. having a submodule with URL "../submodule" will look for the submodule at "repo/../submodule". With the introduction of worktrees, though, we cannot simply resolve the URL relative to the repository location itself. If the repository for which a URL is to be resolved is a working tree, we have to resolve the URL relative to the parent's repository path. Otherwise, the URL would change depending on where the working tree is located. Fix this by special-casing when we have a working tree while getting the URL base.
Patrick Steinhardt committed
-