| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
merge: lock index during the merge (not just checkout)
|
| |
| |
| |
| |
| | |
Provide git_indexwriter_init_for_operation for the common locking
pattern in merge, rebase, revert and cherry-pick.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Always lock the index when we begin the merge, before we write
any of the metdata files. This prevents a race where another
client may run a commit after we have written the MERGE_HEAD but
before we have updated the index, which will produce a merge
commit that is treesame to one parent. The merge will finish and
update the index and the resultant commit would not be a merge at
all.
|
| | |
|
| |
| |
| |
| |
| |
| | |
Introduce `git_indexwriter`, to allow us to lock the index while
performing additional operations, then complete the write (or abort,
unlocking the index).
|
|\ \
| | |
| | | |
allocations: test for overflow of requested size
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
gcc and clang support __builtin_add_overflow, use it whenever
possible, falling back to our naive routines.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Make our overflow checking look more like gcc and clang's, so that
we can substitute it out with the compiler instrinsics on platforms
that support it. This means dropping the ability to pass `NULL` as
an out parameter.
As a result, the macros also get updated to reflect this as well.
|
| | |
| | |
| | |
| | |
| | | |
https://github.com/attractivechaos/klib/pull/42/files introduces
`kreallocarray`. Hook that up as our `git__reallocarray`.
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
Add some helper functions to check for overflow in a type-specific
manner.
|
| | |
| | |
| | |
| | |
| | | |
Ensure that the given length to `p_read` is of ssize_t and ensure
that callers test the return as if it were an `ssize_t`.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Use `size_t` to hold the size of arrays to ease overflow checking,
lest we check for overflow of a `size_t` then promptly truncate
by packing the length into a smaller type.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Have the ALLOC_OVERFLOW testing macros also simply set_oom in the
case where a computation would overflow, so that callers don't
need to.
|
| | |
| | |
| | |
| | |
| | | |
Introduce `git_buf_grow_by` to incrementally increase the size of a
`git_buf`, performing an overflow calculation on the growth.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Introduce git__reallocarray that checks the product of the number
of elements and element size for overflow before allocation. Also
introduce git__mallocarray that behaves like calloc, but without the
`c`. (It does not zero memory, for those truly worried about every
cycle.)
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
Introduce some helper macros to test integer overflow from arithmetic
and set error message appropriately.
|
| | |
| | |
| | |
| | |
| | | |
Switch to a standard branch-switching pattern of a `SAFE` checkout,
then updating `HEAD`.
|
| | |
| | |
| | |
| | |
| | | |
Don't require the branch to rebase, if given `NULL`, simply look up
`HEAD`.
|
| |/
|/|
| |
| |
| | |
Users may want to try to pay attention to the `exec` field on all
rebase operations.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Win32 generally ignores Unix-like mode bits that don't make any
sense on the platform (eg `0644` makes no sense to Windows). But
WINE complains loudly when presented with POSIXy bits. Remove them.
(Thanks @phkelley)
|
|\ \
| | |
| | | |
Reinit `reader` pointer after reading included config file
|
| | |
| | |
| | |
| | |
| | |
| | | |
Fixes #2869. If included file includes more files, it may reallocate
cfg_file->readers, hence invalidate not only `r` pointer, but `result`
pointer as well.
|
|\ \ \
| | | |
| | | | |
Fix build warning on Android
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Always do a time_t cast on st_mtime. st_mtime on Android is not
the type of time_t but has the same meaning which is the number
of seconds past epoch.
|
| |_|/
|/| | |
|
|\ \ \
| | | |
| | | | |
Checkout performance
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
During checkout, assume that the .gitattributes files aren't
modified during the checkout. Instead, create an "attribute session"
during checkout. Assume that attribute data read in the same
checkout "session" hasn't been modified since the checkout started.
(But allow subsequent checkouts to invalidate the cache.)
Further, cache nonexistent git_attr_file data even when .gitattributes
files are not found to prevent re-scanning for nonexistent files.
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
jeffhostetler/jeffhostetler/bug/branch_create_after_namespace
Remove stale reflog namespace directory before branch creation
|
| |/ / /
| | | |
| | | |
| | | | |
branch
|
|\ \ \ \
| | | | |
| | | | | |
Ensure we can make a repo at the root of the filesystem
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Don't try to strip trailing paths from the root directory on
Windows (trying to create `C:` will fail).
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
`p_stat` calls `git_win32_path_from_utf8`, which canonicalizes the
path. Do not further try to modify the path, else we trim the
trailing slash from a root directory and try to access `C:` instead
of `C:/`.
|
| |_|_|/
|/| | | |
|
|/ / /
| | |
| | |
| | |
| | | |
This is a path so we must use the path getter so we get the tilde
expansion done.
|
|\ \ \
| | | |
| | | | |
Handle 8dot3 filenames being disabled on Win32
|
| | | | |
|
| |/ / |
|
| | | |
|
|/ / |
|
|\ \
| | |
| | | |
config: add parsing and getter for paths
|
| |/ |
|