summaryrefslogtreecommitdiff
path: root/t/t4018-diff-funcname.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t4018-diff-funcname.sh')
-rwxr-xr-xt/t4018-diff-funcname.sh31
1 files changed, 25 insertions, 6 deletions
diff --git a/t/t4018-diff-funcname.sh b/t/t4018-diff-funcname.sh
index 740696c..e026fac 100755
--- a/t/t4018-diff-funcname.sh
+++ b/t/t4018-diff-funcname.sh
@@ -53,15 +53,34 @@ do
echo "*.java diff=$p" >.gitattributes &&
test_expect_code 1 git diff --no-index \
A.java B.java 2>msg &&
- test_i18ngrep ! fatal msg &&
- test_i18ngrep ! error msg
+ test_grep ! fatal msg &&
+ test_grep ! error msg
'
test_expect_success "builtin $p wordRegex pattern compiles" '
echo "*.java diff=$p" >.gitattributes &&
test_expect_code 1 git diff --no-index --word-diff \
A.java B.java 2>msg &&
- test_i18ngrep ! fatal msg &&
- test_i18ngrep ! error msg
+ test_grep ! fatal msg &&
+ test_grep ! error msg
+ '
+
+ test_expect_success "builtin $p pattern compiles on bare repo with --attr-source" '
+ test_when_finished "rm -rf bare.git" &&
+ git checkout -B master &&
+ git add . &&
+ echo "*.java diff=notexist" >.gitattributes &&
+ git add .gitattributes &&
+ git commit -am "changing gitattributes" &&
+ git checkout -B branchA &&
+ echo "*.java diff=$p" >.gitattributes &&
+ git add .gitattributes &&
+ git commit -am "changing gitattributes" &&
+ git clone --bare --no-local . bare.git &&
+ git -C bare.git symbolic-ref HEAD refs/heads/master &&
+ test_expect_code 1 git -C bare.git --attr-source=branchA \
+ diff --exit-code HEAD:A.java HEAD:B.java 2>msg &&
+ test_grep ! fatal msg &&
+ test_grep ! error msg
'
done
@@ -69,13 +88,13 @@ test_expect_success 'last regexp must not be negated' '
echo "*.java diff=java" >.gitattributes &&
test_config diff.java.funcname "!static" &&
test_expect_code 128 git diff --no-index A.java B.java 2>msg &&
- test_i18ngrep ": Last expression must not be negated:" msg
+ test_grep ": Last expression must not be negated:" msg
'
test_expect_success 'setup hunk header tests' '
for i in $diffpatterns
do
- echo "$i-* diff=$i"
+ echo "$i-* diff=$i" || return 1
done > .gitattributes &&
# add all test files to the index