Skip to content

Commit 8bba720

Browse files
committed
Merge branch 'as/tree-walk-fix-aggressive-short-cut'
* as/tree-walk-fix-aggressive-short-cut: tree_entry_interesting: match against all pathspecs
2 parents 1ad5417 + e4ddb05 commit 8bba720

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

t/t4010-diff-pathspec.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,17 @@ test_expect_success 'diff-tree ignores trailing slash on submodule path' '
127127
test_cmp expect actual
128128
'
129129

130+
test_expect_success 'diff multiple wildcard pathspecs' '
131+
mkdir path2 &&
132+
echo rezrov >path2/file1 &&
133+
git update-index --add path2/file1 &&
134+
tree3=`git write-tree` &&
135+
git diff --name-only $tree $tree3 -- "path2*1" "path1*1" >actual &&
136+
cat <<-\EOF >expect &&
137+
path1/file1
138+
path2/file1
139+
EOF
140+
test_cmp expect actual
141+
'
142+
130143
test_done

tree-walk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ static enum interesting do_match(const struct name_entry *entry,
749749

750750
if (item->nowildcard_len &&
751751
!match_wildcard_base(item, base_str, baselen, &matched))
752-
return entry_not_interesting;
752+
continue;
753753

754754
/*
755755
* Concatenate base and entry->path into one and do

0 commit comments

Comments
 (0)