Skip to content

Commit

Permalink
t4022: abstract away SHA-1-specific constants
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bk2204 authored and gitster committed May 21, 2018
1 parent f2fffc1 commit 10c636a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions t/t4022-diff-rewrite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
'
Expand All @@ -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 @@
Expand All @@ -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' '
Expand Down

0 comments on commit 10c636a

Please sign in to comment.