summaryrefslogtreecommitdiff
path: root/t/t5510-fetch.sh
diff options
context:
space:
mode:
authorLibravatar Elijah Newren <newren@gmail.com>2020-08-12 07:12:36 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-08-12 12:26:47 -0700
commitab282aa548b807c022d521e83d843e4585b89dbb (patch)
tree3115336797fcc04d48ed32efa0f0371da7e89c81 /t/t5510-fetch.sh
parentt3000: fix some test description typos (diff)
downloadtgif-ab282aa548b807c022d521e83d843e4585b89dbb.tar.xz
dir: avoid prematurely marking nonbare repositories as matches
Nonbare repositories are special directories. Unlike normal directories that we might recurse into to list the files they contain, nonbare repositories must themselves match and then we always report only on the nonbare repository directory itself and not on any of its contents. Separately, when traversing directories to try to find untracked or excluded files, we often think in terms of paths either matching the specified pathspec, or not matching them. However, there is a special value that do_match_pathspec() uses named MATCHED_RECURSIVELY_LEADING_PATHSPEC which means "this directory does not match any pathspec BUT it is possible a file or directory underneath it does." That special value prevents us from prematurely thinking that some directory and everything under it is irrelevant, but also allows us to differentiate from "this is a match". The combination of these two special cases was previously uncovered. Add a test to the testsuite to cover it, and make sure that we return a nonbare repository as a non-match if the best match it got was MATCHED_RECURSIVELY_LEADING_PATHSPEC. Reported-by: christian w <usebees@gmail.com> Simplified-testcase-and-bisection-by: Kyle Meyer <kyle@kyleam.com> Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5510-fetch.sh')
0 files changed, 0 insertions, 0 deletions