summaryrefslogtreecommitdiff
path: root/builtin/rm.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2017-05-11 22:04:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-05-12 05:23:46 (GMT)
commitcbca060e102aedcedbd1c4b5394aeed24885d5de (patch)
treec636c2a0f7f87109b54a38471b3923a9917475a3 /builtin/rm.c
parentc08397e3aa46fd0f0da29dfe5b257839b9c5d1c8 (diff)
downloadgit-cbca060e102aedcedbd1c4b5394aeed24885d5de.zip
git-cbca060e102aedcedbd1c4b5394aeed24885d5de.tar.gz
git-cbca060e102aedcedbd1c4b5394aeed24885d5de.tar.bz2
ls-files: prevent prune_cache from overeagerly pruning submodules
Since (ae8d08242 pathspec: pass directory indicator to match_pathspec_item()) the path matching logic has been able to cope with submodules without needing to strip off a trailing slash if a path refers to a submodule. ls-files is the only caller of 'parse_pathspec()' which relies on the behavior of the PATHSPEC_STRIP_SUBMODULE_SLASH_CHEAP flag because it uses the result to construct a common prefix of all provided pathspecs which is then used to prune the index of all entries which don't have that prefix. Since submodules entries in the index don't have a trailing slash 'prune_cache()' will be overeager and prune a submodule 'sub' if the common prefix is 'sub/'. To correct this behavior, only prune entries which don't match up to, but not including, a trailing slash of the common prefix. This is in preparation to remove the PATHSPEC_STRIP_SUBMODULE_SLASH_CHEAP flag in a later patch. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/rm.c')
0 files changed, 0 insertions, 0 deletions