summaryrefslogtreecommitdiff
path: root/builtin/difftool.c
diff options
context:
space:
mode:
authorLibravatar Brandon Williams <bmwill@google.com>2017-05-11 15:04:25 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-05-12 14:23:46 +0900
commitcbca060e102aedcedbd1c4b5394aeed24885d5de (patch)
treec636c2a0f7f87109b54a38471b3923a9917475a3 /builtin/difftool.c
parentpathspec: remove PATHSPEC_STRIP_SUBMODULE_SLASH_EXPENSIVE flag (diff)
downloadtgif-cbca060e102aedcedbd1c4b5394aeed24885d5de.tar.xz
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/difftool.c')
0 files changed, 0 insertions, 0 deletions