|
21515f22
|
2015-09-29T15:49:16
|
|
index: also try conflict mode when inserting
When we do not trust the on-disk mode, we use the mode of an existing
index entry. This allows us to preserve executable bits on platforms
that do not honor them on the filesystem.
If there is no stage 0 index entry, also look at conflicts to attempt
to answer this question: prefer the data from the 'ours' side, then
the 'theirs' side before falling back to the common ancestor.
|
|
10df661b
|
2015-09-29T14:16:51
|
|
index: test that add_bypath preserves mode
|
|
5c5df666
|
2015-09-27T23:32:20
|
|
Plug some leaks
|
|
ac2fba0e
|
2015-09-16T15:07:27
|
|
git_futils_mkdir_*: make a relative-to-base mkdir
Untangle git_futils_mkdir from git_futils_mkdir_ext - the latter
assumes that we own everything beneath the base, as if it were
being called with a base of the repository or working directory,
and is tailored towards checkout and ensuring that there is no
bogosity beneath the base that must be cleaned up.
This is (at best) slow and (at worst) unsafe in the larger context
of a filesystem where we do not own things and cannot do things like
unlink symlinks that are in our way.
|
|
6d6020de
|
2015-09-08T18:34:51
|
|
Merge pull request #3353 from ethomson/wrongcase_add
index: canonicalize directory case when adding
|
|
2964cbea
|
2015-09-08T11:50:08
|
|
Merge pull request #3381 from leoyanggit/index_directory_iterator
New feature: add the ablility to iterate through a directory in index
|
|
a32bc85e
|
2015-08-07T12:43:49
|
|
git_index_add: allow case changing renames
On case insensitive platforms, allow `git_index_add` to provide a new
path for an existing index entry. Previously, we would maintain the
case in an index entry without the ability to change it (except by
removing an entry and re-adding it.)
Higher-level functions (like `git_index_add_bypath` and
`git_index_add_frombuffers`) continue to keep the old path for easier
usage.
|
|
280adb3f
|
2015-08-04T16:51:00
|
|
index: canonicalize directory case when adding
On case insensitive systems, when given a user-provided path in the
higher-level index addition functions (eg `git_index_add_bypath` /
`git_index_add_frombuffer`), examine the index to try to match the
given path to an existing directory.
Various mechanisms can cause the on-disk representation of a folder
to not match the representation in HEAD or the index - for example,
a case changing rename of some file `a/file.txt` to `A/file.txt`
will update the paths in the index, but not rename the folder on
disk.
If a user subsequently adds `a/other.txt`, then this should be stored
in the index as `A/other.txt`.
|
|
9fd4c9c8
|
2015-09-06T10:50:22
|
|
Merge pull request #3366 from libgit2/cmn/index-hashmap
Use a hashmap for path-based lookups in the index
|
|
c097f717
|
2015-08-17T15:02:02
|
|
New API: git_index_find_prefix
Find the first index entry matching a prefix.
|
|
c232d6c3
|
2015-08-14T21:06:51
|
|
index: add tests around case switching
We were missing tests for switching the case-sensitivity of an index
in-memory and then looking up entries in it.
|
|
bdec3363
|
2015-08-03T17:48:33
|
|
win32: ensure hidden files can be staged
|
|
b426ac90
|
2015-08-01T19:52:25
|
|
index: test that an unregistered submodule gets staged
When we pass the path of a repository to `_bypath()`, we should behave
like git and stage it as a `_COMMIT` regardless of whether it is
registered a a submodule.
|
|
63e5b551
|
2015-07-29T00:08:37
|
|
index: add test for adding an old-style submodule to index
|
|
247d27c2
|
2015-07-11T19:41:03
|
|
index: allow add_bypath to update submodules
Similarly to how git itself does it, allow the index update operation to
stage a change in a submodule's HEAD.
|
|
0d98af09
|
2015-07-11T19:03:38
|
|
blob: fail to create a blob from a dir with EDIRECTORY
This also affects `git_index_add_bypath()` by providing a better error
message and a specific error code when a directory is passed.
|
|
eb29292a
|
2015-06-30T14:25:51
|
|
index tests: add eol to avoid compiler warning
|
|
2cf33fee
|
2015-06-29T15:20:34
|
|
index test: include repository.h for decl
|
|
24fa21f3
|
2015-06-26T18:59:53
|
|
index, iterator, fetchhead: plug leaks
|
|
6e611f7c
|
2015-06-22T14:17:39
|
|
index: add a diff test for smudging a file which becomes empty
Even though the file is empty and thus the size in the entry matches, we
should be able to detect it as a difference.
|
|
27133caf
|
2015-06-20T17:20:07
|
|
tests: move racy tests to the index
They fit there much better, even though we often check by diffing, it's
about the behaviour of the index.
|
|
46c84c72
|
2015-06-19T21:56:42
|
|
index: user a better assertion when comparing sizes
This will tell us which numbers we were trying to compare, rather than
just telling us that they're different.
|
|
9f3c18e2
|
2015-06-02T08:36:15
|
|
Fixed build warnings on Xcode 6.1
|
|
666ae188
|
2015-05-19T17:52:13
|
|
git_index_add_all: test that conflicts are handled
When confronted with a conflict in the index, `git_index_add_all`
should stage the working directory copy. If there is no file in the
working directory, the conflict should simply be removed.
|
|
9f545b9d
|
2015-05-19T11:23:59
|
|
introduce `git_index_entry_is_conflict`
It's not always obvious the mapping between stage level and
conflict-ness. More importantly, this can lead otherwise sane
people to write constructs like `if (!git_index_entry_stage(entry))`,
which (while technically correct) is unreadable.
Provide a nice method to help avoid such messy thinking.
|
|
2f1080ea
|
2015-05-19T11:17:07
|
|
conflict tests: use GIT_IDXENTRY_STAGE_SET
|
|
d67f270e
|
2015-05-14T13:30:29
|
|
index: validate mode of new conflicts
|
|
ecd60a56
|
2015-05-14T11:52:48
|
|
conflicts: when adding conflicts, remove staged
When adding a conflict for some path, remove the staged entry.
Otherwise, an illegal index (with both stage 0 and high-stage
entries) would result.
|
|
fa9a969d
|
2015-05-20T18:22:17
|
|
index_add_all: include untracked files in new subdirs
|
|
2b2dfe80
|
2015-05-12T12:07:33
|
|
index: include TYPECHANGE in the diff
Without this option, we would not be able to catch exec bit changes.
|
|
35d39761
|
2015-03-18T00:25:18
|
|
index: introduce git_index_read_index
|
|
d3282680
|
2015-04-20T23:41:04
|
|
Fix index-adding functions to know when to trust filemodes.
The idea...sometimes, a filemode is user-specified via an
explicit git_index_entry. In this case, believe the user, always.
Sometimes, it is instead built up by statting the file system. In
those cases, go with the existing logic we have to determine
whether the file system supports all filemodes and symlinks, and
make the best guess.
On file systems which have full filemode and symlink support, this
commit should make no difference. On others (most notably Windows),
this will fix problems things like:
* git_index_add and git_index_add_frombuffer() should be believed.
* As a consequence, git_checkout_tree should make the filemodes in
the index match the ones in the tree.
* And diffs with GIT_DIFF_UPDATE_INDEX don't write the wrong filemodes.
* And merges, and probably other downstream stuff now fixed, too.
This makes my previous changes to checkout.c unnecessary,
so they are now reverted.
Also, added a test for index_entry permissions from git_index_add
and git_index_add_frombuffer, both of which failed before these changes.
|
|
15f58174
|
2015-03-11T17:55:39
|
|
Merge commit 'refs/pull/2879/head' of ssh://github.com/libgit2/libgit2
|
|
23a17803
|
2015-01-07T14:16:50
|
|
reset: remove reflog message override
This function is meant to simulate what git does in the reset command,
so we should include the reflog message in that.
|
|
659cf202
|
2015-01-07T12:23:05
|
|
Remove the signature from ref-modifying functions
The signature for the reflog is not something which changes
dynamically. Almost all uses will be NULL, since we want for the
repository's default identity to be used, making it noise.
In order to allow for changing the identity, we instead provide
git_repository_set_ident() and git_repository_ident() which allow a user
to override the choice of signature.
|
|
a275fbc0
|
2015-02-05T11:40:16
|
|
Add API to add a memory buffer to an index
git_index_add_frombuffer enables now to store a memory buffer in the odb
and to store an entry in the index directly if the index is attached to a
repository.
|
|
55798fd1
|
2015-01-17T20:49:04
|
|
git_indexwriter: lock then write the index
Introduce `git_indexwriter`, to allow us to lock the index while
performing additional operations, then complete the write (or abort,
unlocking the index).
|
|
28428318
|
2014-12-18T12:41:59
|
|
index tests: test capitalization before mkdir
|
|
c90ed5b5
|
2014-12-18T02:11:06
|
|
Plug leaks
|
|
c679bf42
|
2014-12-18T02:07:36
|
|
Create miscapitialised dirs for case-sensitive filesystems
We need these directories to exist so cl_git_mkfile() can create the
files we ask it to.
|
|
dce7b1a4
|
2014-12-16T19:24:04
|
|
treebuilder: take a repository for path validation
Path validation may be influenced by `core.protectHFS` and
`core.protectNTFS` configuration settings, thus treebuilders
can take a repository to influence their configuration.
|
|
0d388adc
|
2014-11-25T00:58:03
|
|
index: Check for valid paths before creating an index entry
|
|
b874629b
|
2014-12-04T21:06:59
|
|
Spelling fixes
|
|
cdd71711
|
2014-10-13T14:34:32
|
|
Clean up some memory leaks
|
|
bb0757d5
|
2014-10-22T21:09:31
|
|
tree-cache: correct the entry_count calculation
The entry_count field is the amount of index entries covered by a
particular cache entry, that is how many files are there (recursively)
under a particular directory.
The current code that attemps to do this is severely defincient and is
trying to count the amount of children, which always comes up to zero.
We don't even need to recount, since we have the information during the
cache creation. We can take that number and keep it, as we only ever
invalidate or replace.
|
|
795d8e93
|
2014-09-29T08:03:22
|
|
index: make sure to write cached subtrees if parent is invalidated
If e.g. the root tree is invalidated, we still want to write out
its children, since those may still have valid cache entries.
|
|
c2f8b215
|
2014-09-28T07:00:49
|
|
index: write out the tree cache extension
Keeping the cache around after read-tree is only one part of the
optimisation opportunities. In order to share the cache between program
instances, we need to write the TREE extension to the index.
Do so, taking the opportunity to rename 'entries' to 'entry_count' to
match the name given in the format description. The included test is
rather trivial, but works as a sanity check.
|
|
ee4db1c1
|
2014-07-11T11:48:51
|
|
index: add tests for the tree cache
These test that we invalidate at the right levels and that we remove the
tree cache when clearing the index.
|
|
b8add6c4
|
2014-08-03T15:44:13
|
|
Allow to propagate checkout callbacks to git HARD reset
Signed-off-by: Sven Strickroth <email@cs-ware.de>
|
|
0cee70eb
|
2014-07-01T14:09:01
|
|
Introduce cl_assert_equal_oid
|
|
69a1a691
|
2014-06-03T16:18:08
|
|
Plug a leak in the tests
|
|
052a2ffd
|
2014-05-22T16:01:02
|
|
index: check for valid filemodes on add
|
|
16798d08
|
2014-05-19T14:57:09
|
|
Make core.safecrlf work on LF-ending platforms
If you enabled core.safecrlf on an LF-ending platform, we would
error even for files with all LFs. We should only be warning on
irreversible mappings, I think.
|
|
c67fd4c9
|
2014-02-07T11:20:36
|
|
Some vector utility tweaks
This is just laying some groundwork for internal index changes
that I'm working on.
|
|
6affd71f
|
2014-01-03T17:38:34
|
|
git_checkout_opts -> git_checkout_options
|
|
0d8265c8
|
2014-02-22T09:25:41
|
|
Staticize file-local variables
|
|
9780020b
|
2014-02-09T13:37:39
|
|
Tests for crlf filtering into the repository
|
|
2d929194
|
2014-02-07T16:14:17
|
|
Merge pull request #2099 from libgit2/bs/more-reflog-stuff
More reflogness
|
|
43709ca8
|
2014-02-04T10:33:30
|
|
Fix typo setting sorted flag when reloading index
This fixes a typo I made for setting the sorted flag on the index
after a reload. That typo didn't actually cause any test failures
so I'm also adding a test that explicitly checks that the index is
correctly sorted after a reload when ignoring case and when not.
|
|
882c7742
|
2014-02-04T10:01:37
|
|
Convert pqueue to just be a git_vector
This updates the git_pqueue to simply be a set of specialized
init/insert/pop functions on a git_vector.
To preserve the pqueue feature of having a fixed size heap, I
converted the "sorted" field in git_vectors to a more general
"flags" field so that pqueue could mix in it's own flag. This
had a bunch of ramifications because a number of places were
directly looking at the vector "sorted" field - I added a couple
new git_vector helpers (is_sorted, set_sorted) so the specific
representation of this information could be abstracted.
|
|
586be3b8
|
2014-02-03T15:05:55
|
|
Add reflog parameters to git_reset
|
|
0d847a31
|
2014-02-03T14:08:40
|
|
Reset helpers: use revparse instead
|
|
bae8bea0
|
2014-01-29T12:53:01
|
|
More index collision tests
|
|
95fbedcd
|
2014-01-28T16:22:37
|
|
Add test for blob/tree name collisions in index
|
|
d541170c
|
2014-01-24T11:36:41
|
|
index: rename an entry's id to 'id'
This was not converted when we converted the rest, so do it now.
|
|
8b22d862
|
2013-12-11T11:55:00
|
|
More improvements to callback return value tests
This time actually checking return values in diff notify tests and
actually testing callbacks for the index all-all/update-all/etc
functions.
|
|
65f67857
|
2013-11-19T14:25:30
|
|
tests: Drop unrelated comment
|
|
3d523345
|
2013-11-19T13:15:47
|
|
tree-cache: Don't segfault upon corruption
|
|
17820381
|
2013-11-14T14:05:52
|
|
Rename tests-clar to tests
|