Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
t4042: abstract away SHA-1-specific constants
author
brian m. carlson
<sandals@crustytoothpaste.net>
Mon, 21 May 2018 02:01:44 +0000
(
02:01
+0000)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 21 May 2018 04:55:48 +0000
(13:55 +0900)
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>
t/t4042-diff-textconv-caching.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
2a73022
)
diff --git
a/t/t4042-diff-textconv-caching.sh
b/t/t4042-diff-textconv-caching.sh
index 04a44d5c61495c4c87db6ada952f5652b8e17642..bf33aedf4b22868fd820330a460965d27e66cb91 100755
(executable)
--- 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 &&
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 &&
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
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
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
--- 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..1345db
2 100644
+index
$foo1..$foo
2 100644
--- a/foo.bin
+++ b/foo.bin
@@ -1 +1 @@
--- 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
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 @@
--- 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
-converted: bar content 1
+converted: bar content 2
diff --git a/foo.bin b/foo.bin
-index
d5b9fe3..1345db
2 100644
+index
$foo1..$foo
2 100644
--- a/foo.bin
+++ b/foo.bin
@@ -1,2 +1,2 @@
--- 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
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 @@
--- 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
-converted: bar content 1
+converted: bar content 2
diff --git a/foo.bin b/foo.bin
-index
d5b9fe3..1345db
2 100644
+index
$foo1..$foo
2 100644
--- a/foo.bin
+++ b/foo.bin
@@ -1 +1 @@
--- a/foo.bin
+++ b/foo.bin
@@ -1 +1 @@