Skip to content

Commit 6988f43

Browse files
committed
Merge pull request #365 from rkennedy/bug-ignore-regex2
Don't treat ignored patterns as regexps
2 parents 438de98 + e2b6eaf commit 6988f43

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bin/git-ignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function add_patterns {
3232
local file="${1/#~/$HOME}"
3333
for pattern in "${@:2}"; do
3434
echo "... adding '$pattern'"
35-
(test -f "$file" && test "$pattern" && grep -q -- "$pattern" "$file") || echo "$pattern" >> "$file"
35+
(test -f "$file" && test "$pattern" && grep -q -F -x -- "$pattern" "$file") || echo "$pattern" >> "$file"
3636
done
3737
}
3838

0 commit comments

Comments
 (0)