summaryrefslogtreecommitdiff
path: root/t/t0003-attributes.sh
diff options
context:
space:
mode:
authorThomas Rast <trast@student.ethz.ch>2013-03-01 20:06:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-03-01 20:24:45 (GMT)
commit8b1bd024154f0ee0d71a6befe9bbd96462e76abc (patch)
tree08c39a9a729bd3d02f632f95b550322abc8fde68 /t/t0003-attributes.sh
parent1d38c6971dd1a4b054d90b7ae4c9de5400b9d818 (diff)
downloadgit-8b1bd024154f0ee0d71a6befe9bbd96462e76abc.zip
git-8b1bd024154f0ee0d71a6befe9bbd96462e76abc.tar.gz
git-8b1bd024154f0ee0d71a6befe9bbd96462e76abc.tar.bz2
Make !pattern in .gitattributes non-fatal
Before 82dce99 (attr: more matching optimizations from .gitignore, 2012-10-15), .gitattributes did not have any special treatment of a leading '!'. The docs, however, always said The rules how the pattern matches paths are the same as in `.gitignore` files; see linkgit:gitignore[5]. By those rules, leading '!' means pattern negation. So 82dce99 correctly determined that this kind of line makes no sense and should be disallowed. However, users who actually had a rule for files starting with a '!' are in a bad position: before 82dce99 '!' matched that literal character, so it is conceivable that users have .gitattributes with such lines in them. After 82dce99 the unescaped version was disallowed in such a way that git outright refuses to run(!) most commands in the presence of such a .gitattributes. It therefore becomes very hard to fix, let alone work with, such repositories. Let's at least allow the users to fix their repos: change the fatal error into a warning. Reported-by: mathstuf@gmail.com Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0003-attributes.sh')
-rwxr-xr-xt/t0003-attributes.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/t/t0003-attributes.sh b/t/t0003-attributes.sh
index 807b8b8..1035a14 100755
--- a/t/t0003-attributes.sh
+++ b/t/t0003-attributes.sh
@@ -198,7 +198,8 @@ test_expect_success 'root subdir attribute test' '
test_expect_success 'negative patterns' '
echo "!f test=bar" >.gitattributes &&
- test_must_fail git check-attr test -- f
+ git check-attr test -- '"'"'!f'"'"' 2>errors &&
+ test_i18ngrep "Negative patterns are ignored" errors
'
test_expect_success 'patterns starting with exclamation' '