summaryrefslogtreecommitdiff
path: root/t/t4018-diff-funcname.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-05-17 10:11:41 -0700
committerJunio C Hamano <gitster@pobox.com>2023-05-17 10:11:41 -0700
commit67a3b2b39f638872531324e03217fa58f7b9ad1e (patch)
tree5c4e9c7b9e2c0efc9c9f9e7e70fb11b104f95890 /t/t4018-diff-funcname.sh
parent3307f7dde2ae8f5281d0782f7291a073c9b1cdc2 (diff)
parent44451a2e5eec5360378be23e2cdbd9ecee49e14e (diff)
downloadgit-67a3b2b39f638872531324e03217fa58f7b9ad1e.tar.gz
Merge branch 'jc/attr-source-tree'
"git --attr-source=<tree> cmd $args" is a new way to have any command to read attributes not from the working tree but from the given tree object. * jc/attr-source-tree: attr: teach "--attr-source=<tree>" global option to "git"
Diffstat (limited to 't/t4018-diff-funcname.sh')
-rwxr-xr-xt/t4018-diff-funcname.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t4018-diff-funcname.sh b/t/t4018-diff-funcname.sh
index 42a2b9a13b..c8d555771d 100755
--- a/t/t4018-diff-funcname.sh
+++ b/t/t4018-diff-funcname.sh
@@ -63,6 +63,25 @@ do
test_i18ngrep ! fatal msg &&
test_i18ngrep ! 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_i18ngrep ! fatal msg &&
+ test_i18ngrep ! error msg
+ '
done
test_expect_success 'last regexp must not be negated' '