Skip to content

Commit 078b254

Browse files
committed
Merge branch 'nd/include-if-wildmatch'
A buglet in configuration parser has been fixed. * nd/include-if-wildmatch: config: correct '**' matching in includeIf patterns
2 parents 6b42805 + 19e7fda commit 078b254

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ static int include_by_gitdir(const struct config_options *opts,
242242
}
243243

244244
ret = !wildmatch(pattern.buf + prefix, text.buf + prefix,
245-
icase ? WM_CASEFOLD : 0);
245+
WM_PATHNAME | (icase ? WM_CASEFOLD : 0));
246246

247247
if (!ret && !already_tried_absolute) {
248248
/*

t/t1305-config-include.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,19 @@ test_expect_success 'conditional include, early config reading' '
229229
)
230230
'
231231

232+
test_expect_success 'conditional include with /**/' '
233+
REPO=foo/bar/repo &&
234+
git init $REPO &&
235+
cat >>$REPO/.git/config <<-\EOF &&
236+
[includeIf "gitdir:**/foo/**/bar/**"]
237+
path=bar7
238+
EOF
239+
echo "[test]seven=7" >$REPO/.git/bar7 &&
240+
echo 7 >expect &&
241+
git -C $REPO config test.seven >actual &&
242+
test_cmp expect actual
243+
'
244+
232245
test_expect_success SYMLINKS 'conditional include, set up symlinked $HOME' '
233246
mkdir real-home &&
234247
ln -s real-home home &&

0 commit comments

Comments
 (0)