Skip to content

Commit 5f7b338

Browse files
committed
Merge branch 'fg/maint-exclude-bq' into maint
* fg/maint-exclude-bq: Support "\" in non-wildcard exclusion entries
2 parents bbc6a14 + dd482ee commit 5f7b338

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

dir.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ int match_pathspec(const char **pathspec, const char *name, int namelen,
137137

138138
static int no_wildcard(const char *string)
139139
{
140-
return string[strcspn(string, "*?[{")] == '\0';
140+
return string[strcspn(string, "*?[{\\")] == '\0';
141141
}
142142

143143
void add_exclude(const char *string, const char *base,

t/t3001-ls-files-others-exclude.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ do
1919
>$dir/a.$i
2020
done
2121
done
22+
>"#ignore1"
23+
>"#ignore2"
24+
>"#hidden"
2225

2326
cat >expect <<EOF
2427
a.2
@@ -42,6 +45,9 @@ three/a.8
4245
EOF
4346

4447
echo '.gitignore
48+
\#ignore1
49+
\#ignore2*
50+
\#hid*n
4551
output
4652
expect
4753
.gitignore
@@ -79,9 +85,10 @@ test_expect_success \
7985
>output &&
8086
test_cmp expect output'
8187

82-
cat > excludes-file << EOF
88+
cat > excludes-file <<\EOF
8389
*.[1-8]
8490
e*
91+
\#*
8592
EOF
8693

8794
git config core.excludesFile excludes-file

0 commit comments

Comments
 (0)