Skip to content

Commit 10c636a

Browse files
bk2204gitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f2fffc1 commit 10c636a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

t/t4022-diff-rewrite.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ test_expect_success setup '
1313
"nopqrstuvwxyzabcdefghijklmNOPQRSTUVWXYZABCDEFGHIJKLM" \
1414
<"$TEST_DIRECTORY"/../COPYING >test &&
1515
echo "to be deleted" >test2 &&
16+
blob=$(git hash-object test2) &&
17+
blob=$(git rev-parse --short $blob) &&
1618
git add test2
1719
1820
'
@@ -27,7 +29,7 @@ test_expect_success 'detect rewrite' '
2729
cat >expect <<EOF
2830
diff --git a/test2 b/test2
2931
deleted file mode 100644
30-
index 4202011..0000000
32+
index $blob..0000000
3133
--- a/test2
3234
+++ /dev/null
3335
@@ -1 +0,0 @@
@@ -43,7 +45,7 @@ test_expect_success 'show deletion diff without -D' '
4345
cat >expect <<EOF
4446
diff --git a/test2 b/test2
4547
deleted file mode 100644
46-
index 4202011..0000000
48+
index $blob..0000000
4749
EOF
4850
test_expect_success 'suppress deletion diff with -D' '
4951

0 commit comments

Comments
 (0)