diff options
author | René Scharfe <l.s.r@web.de> | 2020-08-22 10:57:59 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-08-22 13:37:43 -0700 |
commit | bfda204ade8a19357cf073c98dc3a5043533b4c4 (patch) | |
tree | be3bb1b81c3ead7c0753dd907079848114dd5faa /string-list.c | |
parent | Merge branch 'am/pathspec-f-f-checkout' (diff) | |
download | tgif-bfda204ade8a19357cf073c98dc3a5043533b4c4.tar.xz |
checkout, restore: make pathspec recursive
The pathspec given to git checkout and git restore is used with both
tree_entry_interesting (via read_tree_recursive) and match_pathspec
(via ce_path_match). The latter effectively only supports recursive
matching regardless of the value of the pathspec flag "recursive",
which is unset here.
That causes different match results for pathspecs with wildcards, and
can lead checkout and restore in no-overlay mode to remove entries
instead of modifying them. Enable recursive matching for both checkout
and restore to make matching consistent.
Setting the flag in checkout_main() technically also affects git switch,
but since that command doesn't accept pathspecs at all this has no
actual consequence.
Reported-by: Sergii Shkarnikov <sergii.shkarnikov@globallogic.com>
Initial-test-by: Sergii Shkarnikov <sergii.shkarnikov@globallogic.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'string-list.c')
0 files changed, 0 insertions, 0 deletions