| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
The `git_blob_filter_options_init` function should be included, to allow
callers in FFI environments to let us initialize an options structure
for them.
|
|
|
|
|
|
| |
IPv6 addresses should be used identically internally; we should not
denote them with brackets in one operating system and without them in
another.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change makes it possible to build with newer versions of gcc
without warnings. There were two warnings issued:
* gcc 8 added
[`-Wstringop-truncation`](https://developers.redhat.com/blog/2018/05/24/detecting-string-truncation-with-gcc-8/),
which warns if a call to `strncpy(3)` is prone to accidentally
truncating the destination string, since `strncpy(3)` does NOT add a
terminating `NULL` if the destination buffer is not large enough to
hold the input.
This change uses the pattern suggested in
https://us-cert.cisa.gov/bsi/articles/knowledge/coding-practices/strncpy-and-strncat
to fix the locations flagged by gcc.
* There was a potentially uninitialized access of `dest` in `fs_copy`.
|
|
|
|
|
|
|
|
|
| |
As it turns out, the implementation of `git__multiply_int64_overflow` is
full of edge cases and tricky arithmetic. That means that it should have
unit tests.
As a result, a bug in `git__strntol64` was found (and fixed!) in
clang+32-bit.
|
|
|
|
|
|
| |
Using RC4 is not a _certificate_ problem, it's a cipher problem. The
SSL implementation should and will fail with an unrecoverable error
(-1). There's no opportunity to accept/continue.
|
|
|
|
|
|
| |
This used to fail with an error indicating a mis-use of OpenSSL on platforms
using it due to poor error handling. Re-enable it even if this isn't the right
error code to use for now.
|
|
|
|
| |
Use a no-allocation approach to the TLS data abstraction.
|
| |
|
|
|
|
|
| |
Clarify the `git_atomic` type and functions now that we have a 64 bit
version as well (`git_atomic64`).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change fixes a packfile heap corruption that can happen when
interacting with multiple packfiles concurrently across multiple
threads. This is exacerbated by setting a lower mwindow open file limit.
This change:
* Renames most of the internal methods in pack.c to clearly indicate
that they expect to be called with a certain lock held, making
reasoning about the state of locks a bit easier.
* Splits the `git_pack_file` lock in two: the one in `git_pack_file`
only protects the `index_map`. The protection to `git_mwindow_file` is
now in that struct.
* Explicitly checks for freshness of the `git_pack_file` in
`git_packfile_unpack_header`: this allows the mwindow implementation
to close files whenever there is enough cache pressure, and
`git_packfile_unpack_header` will reopen the packfile if needed.
* After a call to `p_munmap()`, the `data` and `len` fields are poisoned
with `NULL` to make use-after-frees more evident and crash rather than
being open to the possibility of heap corruption.
* Adds a test case to prevent this from regressing in the future.
Fixes: #5591
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change adds support for reading multi-pack-index files from the
packfile odb backend. This also makes git_pack_file objects open their
backing failes lazily in more scenarios, since the multi-pack-index can
avoid having to open them in some cases (yay!).
This change also refreshes the documentation found in src/odb_pack.c to
match the updated code.
Part of: #5399
|
| |
|
|\
| |
| | |
msvc crtdbg -> win32 leakcheck
|
| | |
|
| |
| |
| |
| |
| | |
msvc crtdbg is a mouthfull that is not particularly indicative of what
it does. Let's rename it to "win32 leakcheck".
|
|\ \
| |/
|/| |
Add missing worktree_dir check and test case
|
| | |
|
| | |
|
| |
| |
| |
| | |
worktree_dir isn't validated when it should be
|
| |
| |
| |
| | |
Signed-off-by: Sven Strickroth <email@cs-ware.de>
|
| |
| |
| |
| | |
Signed-off-by: Sven Strickroth <email@cs-ware.de>
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
Disambiguate invalid specifications in `git_refspec__parse` so that
callers can determine the difference between invalid specifications and
actual errors. No call sites wil propagagte this new error message to
an end-user, so there is no user-facing API change.
|
|/ |
|
|\
| |
| | |
Refactor "global" state
|
| |
| |
| |
| |
| | |
Provide a mechanism for system components to register for initialization
and shutdown of the libgit2 runtime.
|
| |
| |
| |
| | |
We were never properly testing git_thread_exit. Do so.
|
| |
| |
| |
| |
| | |
Move the settings global data teardown into its own separate function,
instead of intermingled with the global state.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change:
* Increases MY_ROW_LIMIT to 2M, since it has been failing in #5595's
tests since it's _super_ close to the limit.
* Calls `git_repository_free()` on a `git_repository` that was being
leaked only in Windows.
* Marks the global `git_repository` on `tests/repo/init.c` as `NULL`
after being freed to make any accidental access more noisy.
* Uses `cl_assert_equal_i()` in `test_trace_windows_stacktrace__leaks`
to make the test failures more actionable.
* Renames the globals in `tests/repo/init.c` so that they don't start
with an underscore.
|
|
|
|
|
| |
Ensure that we created `refs/remotes/origin/HEAD` when cloning, a
symbolic link pointing to `refs/remotes/origin/<default>`
|
|
|
|
|
|
|
| |
This change is the first in a series to add support for git's
multi-pack-index. This should speed up large repositories significantly.
Part of: #5399
|
|\
| |
| | |
Fix binary diff showing /dev/null
|
| |
| |
| |
| |
| |
| | |
Fixes issue where a changed binary file's content in the working
tree isn't displayed correctly, instead showing an oid of zero,
and with its path being reported incorrectly as "/dev/null".
|
|\ \
| | |
| | | |
Respect `init.defaultBranch` setting
|
| | |
| | |
| | |
| | |
| | |
| | | |
When cloning an empty repository, we need to guess what the branch
structure should be; instead of hardcoding `master`, use the
`init.defaultBranch` setting it if it provided.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
As part of a push towards more inclusive language, git is reconsidering
using "master" as the default branch name. As a first step, this
setting will be configurable with the `init.defaultBranch` configuration
option. Honor this during repository initialization.
During initialization, we will create an initial branch:
1. Using the `initial_head` setting, if specified;
2. Using the `HEAD` configured in a template, if it exists;
3. Using the `init.defaultBranch` configuration option, if it is set; or
4. Using `master` in the absence of additional configuration.
|
|\ \ \
| | | |
| | | | |
patch_parse: handle absence of "index" header for new/deleted cases
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This follows up on 11de594f85479e4804b07dc4f7b33cfe9212bea0 which added
support for parsing patches without extended headers (the "index
<hash>..<hash> <mode>" line); issue #5267.
We now allow transition from "file mode" state to "path" state directly
if there is no "index", which will happen for patches adding or deleting
files as demonstrated in added test case.
|
|\ \ \
| | | |
| | | | |
boolean config parsing fails in some cases with mapped values
|
| | | |
| | | |
| | | |
| | | | |
Signed-off-by: Sven Strickroth <email@cs-ware.de>
|
| | | |
| | | |
| | | |
| | | | |
Signed-off-by: Sven Strickroth <email@cs-ware.de>
|
| | | |
| | | |
| | | |
| | | | |
Signed-off-by: Sven Strickroth <email@cs-ware.de>
|
| |/ /
| | |
| | |
| | |
| | |
| | | |
git_config_lookup_map_value
Signed-off-by: Sven Strickroth <email@cs-ware.de>
|
|\ \ \
| | | |
| | | | |
Fix config file parsing with multi line values containing quoted parts
|
| |/ /
| | |
| | |
| | | |
Signed-off-by: Sven Strickroth <email@cs-ware.de>
|
|\ \ \
| | | |
| | | | |
diff stats: fix segfaults with new files
|
| |/ / |
|
| | | |
|