diff options
author | Derrick Stolee <dstolee@microsoft.com> | 2021-07-14 13:12:31 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-07-14 13:42:48 -0700 |
commit | cd807a5cdabe5720071d91801dbc76faa8a643ba (patch) | |
tree | 68f9a867fd32a22c1a47c9bd1347342c6252fb5b /templates/hooks--update.sample | |
parent | unpack-trees: preserve cache_bottom (diff) | |
download | tgif-cd807a5cdabe5720071d91801dbc76faa8a643ba.tar.xz |
unpack-trees: compare sparse directories correctly
As we further integrate the sparse-index into unpack-trees, we need to
ensure that we compare sparse directory entries correctly with other
entries. This affects searching for an exact path as well as sorting
index entries.
Sparse directory entries contain the trailing directory separator. This
is important for the sorting, in particular. Thus, within
do_compare_entry() we stop using S_IFREG in all cases, since sparse
directories should use S_IFDIR to indicate that the comparison should
treat the entry name as a dirctory.
Within compare_entry(), it first calls do_compare_entry() to check the
leading portion of the name. When the input path is a directory name, we
could match exactly already. Thus, we should return 0 if we have an
exact string match on a sparse directory entry. The final check is a
length comparison between the strings.
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'templates/hooks--update.sample')
0 files changed, 0 insertions, 0 deletions