summaryrefslogtreecommitdiff
path: root/t/t4042-diff-textconv-caching.sh
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2018-05-21 02:01:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-21 04:55:48 (GMT)
commite4c565230450b70d78764a87553af7900c6b4064 (patch)
tree60392b222a8c38001b2e9024418a63b65503e49c /t/t4042-diff-textconv-caching.sh
parent2a73022e5cd95e01e5923cf3a451f941e48806be (diff)
downloadgit-e4c565230450b70d78764a87553af7900c6b4064.zip
git-e4c565230450b70d78764a87553af7900c6b4064.tar.gz
git-e4c565230450b70d78764a87553af7900c6b4064.tar.bz2
t4042: abstract away SHA-1-specific constants
Adjust the test so that it computes variables for blobs instead of using hard-coded hashes. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4042-diff-textconv-caching.sh')
-rwxr-xr-xt/t4042-diff-textconv-caching.sh16
1 files changed, 10 insertions, 6 deletions
diff --git a/t/t4042-diff-textconv-caching.sh b/t/t4042-diff-textconv-caching.sh
index 04a44d5..bf33aed 100755
--- a/t/t4042-diff-textconv-caching.sh
+++ b/t/t4042-diff-textconv-caching.sh
@@ -15,9 +15,13 @@ test_expect_success 'setup' '
echo bar content 1 >bar.bin &&
git add . &&
git commit -m one &&
+ foo1=$(git rev-parse --short HEAD:foo.bin) &&
+ bar1=$(git rev-parse --short HEAD:bar.bin) &&
echo foo content 2 >foo.bin &&
echo bar content 2 >bar.bin &&
git commit -a -m two &&
+ foo2=$(git rev-parse --short HEAD:foo.bin) &&
+ bar2=$(git rev-parse --short HEAD:bar.bin) &&
echo "*.bin diff=magic" >.gitattributes &&
git config diff.magic.textconv ./helper &&
git config diff.magic.cachetextconv true
@@ -25,14 +29,14 @@ test_expect_success 'setup' '
cat >expect <<EOF
diff --git a/bar.bin b/bar.bin
-index fcf9166..28283d5 100644
+index $bar1..$bar2 100644
--- a/bar.bin
+++ b/bar.bin
@@ -1 +1 @@
-converted: bar content 1
+converted: bar content 2
diff --git a/foo.bin b/foo.bin
-index d5b9fe3..1345db2 100644
+index $foo1..$foo2 100644
--- a/foo.bin
+++ b/foo.bin
@@ -1 +1 @@
@@ -59,7 +63,7 @@ test_expect_success 'cached textconv does not run helper' '
cat >expect <<EOF
diff --git a/bar.bin b/bar.bin
-index fcf9166..28283d5 100644
+index $bar1..$bar2 100644
--- a/bar.bin
+++ b/bar.bin
@@ -1,2 +1,2 @@
@@ -67,7 +71,7 @@ index fcf9166..28283d5 100644
-converted: bar content 1
+converted: bar content 2
diff --git a/foo.bin b/foo.bin
-index d5b9fe3..1345db2 100644
+index $foo1..$foo2 100644
--- a/foo.bin
+++ b/foo.bin
@@ -1,2 +1,2 @@
@@ -84,7 +88,7 @@ test_expect_success 'changing textconv invalidates cache' '
cat >expect <<EOF
diff --git a/bar.bin b/bar.bin
-index fcf9166..28283d5 100644
+index $bar1..$bar2 100644
--- a/bar.bin
+++ b/bar.bin
@@ -1,2 +1,2 @@
@@ -92,7 +96,7 @@ index fcf9166..28283d5 100644
-converted: bar content 1
+converted: bar content 2
diff --git a/foo.bin b/foo.bin
-index d5b9fe3..1345db2 100644
+index $foo1..$foo2 100644
--- a/foo.bin
+++ b/foo.bin
@@ -1 +1 @@