libgit2/tests/index
John Fultz d3282680ed 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.
2015-04-21 02:17:23 -05:00
..
addall.c Staticize file-local variables 2014-02-24 05:32:05 -08:00
cache.c Clean up some memory leaks 2014-10-26 22:27:44 -04:00
collision.c More index collision tests 2014-01-29 13:15:53 -08:00
conflicts.c Introduce cl_assert_equal_oid 2014-07-01 14:40:16 -04:00
crlf.c Introduce cl_assert_equal_oid 2014-07-01 14:40:16 -04:00
filemodes.c Fix index-adding functions to know when to trust filemodes. 2015-04-21 02:17:23 -05:00
inmemory.c Rename tests-clar to tests 2013-11-14 14:05:52 -08:00
names.c reset: remove reflog message override 2015-03-03 14:40:50 +01:00
read_tree.c Introduce cl_assert_equal_oid 2014-07-01 14:40:16 -04:00
rename.c Introduce cl_assert_equal_oid 2014-07-01 14:40:16 -04:00
reuc.c reset: remove reflog message override 2015-03-03 14:40:50 +01:00
stage.c Rename tests-clar to tests 2013-11-14 14:05:52 -08:00
tests.c Add API to add a memory buffer to an index 2015-02-25 10:24:13 +01:00