summaryrefslogtreecommitdiff
path: root/t/t4022-diff-rewrite.sh
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2018-05-21 02:01:38 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-21 04:55:48 (GMT)
commit10c636a79a3786a5089b345032afe4bc23865a97 (patch)
treec2fb72ee9492896f231db8c88da67ba8e02b79a8 /t/t4022-diff-rewrite.sh
parentf2fffc17dcc2c93d0fddbec8f655ebfab2a822ec (diff)
downloadgit-10c636a79a3786a5089b345032afe4bc23865a97.zip
git-10c636a79a3786a5089b345032afe4bc23865a97.tar.gz
git-10c636a79a3786a5089b345032afe4bc23865a97.tar.bz2
t4022: 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/t4022-diff-rewrite.sh')
-rwxr-xr-xt/t4022-diff-rewrite.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/t/t4022-diff-rewrite.sh b/t/t4022-diff-rewrite.sh
index cb51d9f..6d1c3d9 100755
--- a/t/t4022-diff-rewrite.sh
+++ b/t/t4022-diff-rewrite.sh
@@ -13,6 +13,8 @@ test_expect_success setup '
"nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM" \
<"$TEST_DIRECTORY"/../COPYING >test &&
echo "to be deleted" >test2 &&
+ blob=$(git hash-object test2) &&
+ blob=$(git rev-parse --short $blob) &&
git add test2
'
@@ -27,7 +29,7 @@ test_expect_success 'detect rewrite' '
cat >expect <<EOF
diff --git a/test2 b/test2
deleted file mode 100644
-index 4202011..0000000
+index $blob..0000000
--- a/test2
+++ /dev/null
@@ -1 +0,0 @@
@@ -43,7 +45,7 @@ test_expect_success 'show deletion diff without -D' '
cat >expect <<EOF
diff --git a/test2 b/test2
deleted file mode 100644
-index 4202011..0000000
+index $blob..0000000
EOF
test_expect_success 'suppress deletion diff with -D' '