| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Instead of going out to strtol, which is made to parse generic numbers,
copy a parse function from git which is specialised for file modes.
|
|
|
|
|
|
|
|
|
|
|
|
| |
When duplicating a `struct git_tree_entry` with
`git_tree_entry_dup` the resulting structure is not allocated
inside a memory pool. As we do a 1:1 copy of the original struct,
though, we also copy the `pooled` field, which is set to `true`
for pooled entries. This results in a huge memory leak as we
never free tree entries that were duplicated from a pooled
tree entry.
Fix this by marking the newly duplicated entry as un-pooled.
|
|\
| |
| | |
Improvements to tree parsing speed
|
| |
| |
| |
| |
| |
| | |
Return an error in case the length is too big. Also take this
opportunity to have a single allocating function for the size and
overflow logic.
|
| |
| |
| |
| |
| |
| | |
This reduces the size of the struct from 32 to 26 bytes, and leaves a
single padding byte at the end of the struct (which comes from the
zero-length array).
|
| |
| |
| |
| |
| | |
We already know the size due to the `memchr()` so use that information
instead of calling `strlen()` on it.
|
| |
| |
| |
| |
| |
| |
| | |
These are rather small allocations, so we end up spending a non-trivial
amount of time asking the OS for memory. Since these entries are tied to
the lifetime of their tree, we can give the tree a pool so we speed up
the allocations.
|
| |
| |
| |
| |
| |
| |
| | |
We've already looked at the filename with `memchr()` and then used
`strlen()` to allocate the entry. We already know how much we have to
advance to get to the object id, so add the filename length instead of
looking at each byte again.
|
| | |
|
|\ \
| |/
|/| |
Recursive Merge
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When building a recursive merge base, allow conflicts to occur.
Use the file (with conflict markers) as the common ancestor.
The user has already seen and dealt with this conflict by virtue
of having a criss-cross merge. If they resolved this conflict
identically in both branches, then there will be no conflict in the
result. This is the best case scenario.
If they did not resolve the conflict identically in the two branches,
then we will generate a new conflict. If the user is simply using
standard conflict output then the results will be fairly sensible.
But if the user is using a mergetool or using diff3 output, then the
common ancestor will be a conflict file (itself with diff3 output,
haha!). This is quite terrible, but it matches git's behavior.
|
| |
| |
| |
| |
| |
| |
| | |
Use annotated commits to act as our virtual bases, instead of regular
commits, to avoid polluting the odb with virtual base commits and
trees. Instead, build an annotated commit with an index and pointers
to the commits that it was merged from.
|
| | |
|
| |
| |
| |
| |
| |
| | |
When there are more than two common ancestors, continue merging the
virtual base with the additional common ancestors, effectively
octopus merging a new virtual base.
|
| | |
|
| |
| |
| |
| |
| | |
When the commits to merge have multiple common ancestors, build a
"virtual" base tree by merging the common ancestors.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
When examining the working directory and determining whether it's
up-to-date, only consider the nanoseconds in the index entry when
built with `GIT_USE_NSEC`. This prevents us from believing that
the working directory is always dirty when the index was originally
written with a git client that uinderstands nsecs (like git 2.x).
|
|\ \
| |/
|/| |
Fix <0 unsigned comparison (stat.st_size should be an off_t)
|
| | |
|
|\ \
| | |
| | | |
Stat fixes
|
| |/ |
|
|/
|
|
| |
These are not quite like their plain counterparts and require special handling.
|
|\
| |
| | |
Racy fixes for writing new indexes
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Ensure that `git_index_read_index` clears the uptodate bit on
files that it modifies.
Further, do not propagate the cache from an on-disk index into
another on-disk index. Although this should not be done, as
`git_index_read_index` is used to bring an in-memory index into
another index (that may or may not be on-disk), ensure that we do
not accidentally bring in these bits when misused.
|
| |
| |
| |
| |
| |
| | |
The uptodate bit should have a lifecycle of a single read->write
on the index. Once the index is written, the files within it should
be scanned for racy timestamps against the new index timestamp.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Keep track of entries that we believe are up-to-date, because we
added the index entries since the index was loaded. This prevents
us from unnecessarily examining files that we wrote during the
cleanup of racy entries (when we smudge racily clean files that have
a timestamp newer than or equal to the index's timestamp when we
read it). Without keeping track of this, we would examine every
file that we just checked out for raciness, since all their timestamps
would be newer than the index's timestamp.
|
| |
| |
| |
| |
| |
| | |
When examining paths that are racily clean, do a single index->workdir
diff over the entirety of the racily clean files, instead of a diff
per file.
|
|/
|
|
|
|
| |
Allow users to set the `git_libgit2_opts` search path for the
`GIT_CONFIG_LEVEL_PROGRAMDATA`. Convert `GIT_CONFIG_LEVEL_PROGRAMDATA`
to `GIT_SYSDIR_PROGRAMDATA` for setting the configuration.
|
| |
|
|\
| |
| | |
git_index_entry__init_from_stat: set nsec fields in entry stats
|
| | |
|
| | |
|
| |\ |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
This allows us to remove OS checks from source code, instead relying
on CMake to detect whether or not `struct stat` has the nanoseconds
members we rely on.
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | | |
Improve error messages when dirs prevent ref/reflog creation
|
| | | |
| | | |
| | | |
| | | |
| | | | |
When a non-empty directory exists and prevents the creation of a
reflog, provide a more informative error message.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
When a (non-empty) directory exists at the reference target
location, complain with a more actionable error message.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
When creating a filebuf, detect a directory that exists in our
target file location. This prevents a failure later, when we try
to move the lock file to the destination.
|
|\ \ \ \
| | | | |
| | | | | |
Support setting custom user-agent
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
We also keep the "git/1.0" prefix in order to maintain compatibility
with hosters.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
We still prefix it with "git/1.0" since that's required in many
situations, but we replace the area which mentions libgit2.
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
When we insert a conflict in a case-insensitive index, accept the
new entry's path as the correct case instead of leaving the path we
already had.
This puts `git_index_conflict_add()` on the same level as
`git_index_add()` in this respect.
|