| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
The callback mechanism makes it awkward to write data from an IO
source; move to `_fromstream()` which lets the caller remain in control,
in the same vein as we prefer iterators over foreach callbacks.
|
| |
|
|
|
|
|
|
|
|
| |
By returning when the count goes to zero rather than below it, setting
`howmany` to 7 in fact writes out the string 6 times.
Correct the termination condition to write out the string the amount of
times we specify.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The pair of `git_blob_create_frombuffer()` and
`git_blob_create_frombuffer_commit()` is meant to replace
`git_blob_create_fromchunks()` by providing a way for a user to write a
new blob when they want filtering or they do not know the size.
This approach allows the caller to retain control over when to add data
to this buffer and a more natural fit into higher-level language's own
stream abstractions instead of having to handle IO wait in the callback.
The in-memory buffer size of 2MB is chosen somewhat arbitrarily to be a
round multiple of usual page sizes and a value where most blobs seem
likely to be either going to be way below or way over that size. It's
also a round number of pages.
This implementation re-uses the helper we have from `_fromchunks()` so
we end up writing everything to disk, but hopefully more efficiently
than with a default filebuf. A later optimisation can be to avoid
writing the in-memory contents to disk, with some extra complexity.
|
|
|
|
|
|
| |
Allow setting the buffer size on open in order to use this data
structure more generally as a spill buffer, with larger buffer sizes for
specific use-cases.
|
|\
| |
| | |
Add a sanity check in git_indexer_commit to avoid subtraction overflow.
|
| | |
|
|\ \
| | |
| | | |
Fix some errors I found in the changelog for 0.24.0
|
| | | |
|
|\ \ \
| | | |
| | | | |
Reuse a tree's buffer and allocate constant-sized entries in an array
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Take advantage of the constant size of tree-owned arrays and store them
in an array instead of a pool. This still lets us free them all at once
but lets the system allocator do the work of fitting them in.
|
|/ / /
| | |
| | |
| | |
| | | |
Instead of copying over the data into the individual entries, point to
the originals, which are already in a format we can use.
|
|\ \ \
| | | |
| | | | |
win32: free thread-local data on thread exit
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
MinGW builds should optionally create DLLs without "lib" prefix
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This is especially useful in combination with MinGW to yield the
Windows-compliant DLL name "git2.dll" instead of "libgit2.dll"
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Custom merge drivers and proper gitattributes `merge` handling
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Since the `apply` callback can defer, the `check` callback is not
necessary. Removing the `check` callback further makes the `payload`
unnecessary along with the `cleanup` callback.
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Ensure that setting the merge attribute forces the built-in default
`text` driver and does *not* honor the `merge.default` configuration
option. Further ensure that unsetting the merge attribute forces
a conflict (the `binary` driver).
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Allow merge users to configure a custom default merge driver via
`git_merge_options`. Similarly, honor the `merge.default` configuration
option.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
When a `check` or `apply` callback function returns `GIT_EMERGECONFLICT`
stop and product a conflict.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
When a `check` or `apply` callback function returns `GIT_PASSTHROUGH`,
move on to the default merge driver.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Consumers can now register custom merged drivers with
`git_merge_driver_register`. This allows consumers to support the
merge drivers, as configured in `.gitattributes`. Consumers will be
asked to perform the file-level merge when a custom driver is
configured.
|
| | | | | | |
|
| | | | | | |
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
CONTRIBUTING: document the optional tests
|
|/ / / / / |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
commit: add function to attach a signature to a commit
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
In combination with the function which creates a commit into a buffer,
this allows us to more easily create signed commits.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Test memleaks
|
| | | | | | | |
|
| |/ / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
git_buf_clear does not free allocated memory associated with a
git_buf. Use `git_buf_free` instead to correctly free its memory
and plug the memory leak.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
CMake: do not overwrite but only append to CMAKE_C_FLAGS_DEBUG
|
| | |/ / / /
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This is useful to force "smart" IDEs (like CLIon) to use debug
flag -g even it may have decided that "-D_DEBUG" (which is
already present) is sufficient.
|
|\ \ \ \ \ \
| |_|_|/ / /
|/| | | | | |
commit: fix extraction of single-line signatures
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The function to extract signatures suffers from a similar bug to the
header field finding one by having an unecessary line feed check as a
break condition of its loop.
Fix that and add a test for this single-line signature situation.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
win32: choose the page size as our value for the page size
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
While often similar, these are not the same on Windows. We want to use the page
size on Windows for the pools, but for mmap we need to use the allocation
granularity as the alignment.
On the other platforms these values remain the same.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Coverity fixes round 7
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Callers of `git_config__cvar` already handle the case where the
function returns an error due to a failed configuration variable
lookup, but we are actually swallowing errors when calling
`git_config__lookup_entry` inside of the function.
Fix this by returning early when `git_config__lookup_entry`
returns an error. As we call `git_config__lookup_entry` with
`no_errors == false` which leads us to call `get_entry` with
`GET_NO_MISSING` we will not return early when the lookup fails
due to a missing entry. Like this we are still able to set the
default value of the cvar and exit successfully.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
When writing to a file with locking not check if writing the
locked file actually succeeds. Fix the issue by returning error
code and message when writing fails.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Accessing the current values map is handled through the
`refcounder_strmap_take` function, which first acquires a mutex
before accessing its values. While this assures everybody is
trying to access the values with the mutex only we do not check
if the locking actually succeeds.
Fix the issue by checking if acquiring the lock succeeds and
returning `NULL` if we encounter an error. Adjust callers.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
When normalizing options we try to look up HEAD's OID. While this
action may fail in malformed repositories we never check the
return value of the function.
Fix the issue by converting `normalize_options` to actually
return an error and handle the error in `git_blame_file`.
|
| | | | | | |
|