Skip to content

Commit b55ee57

Browse files
bk2204gitster
authored andcommitted
t4029: 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 7022ba3 commit b55ee57

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

t/t4029-diff-trailing-space.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ test_description='diff honors config option, diff.suppressBlankEmpty'
66

77
. ./test-lib.sh
88

9-
cat <<\EOF > exp ||
9+
cat <<\EOF >expected ||
1010
diff --git a/f b/f
1111
index 5f6a263..8cb8bae 100644
1212
--- a/f
@@ -20,9 +20,14 @@ exit 1
2020

2121
test_expect_success "$test_description" '
2222
printf "\nx\n" > f &&
23+
before=$(git hash-object f) &&
24+
before=$(git rev-parse --short $before) &&
2325
git add f &&
2426
git commit -q -m. f &&
2527
printf "\ny\n" > f &&
28+
after=$(git hash-object f) &&
29+
after=$(git rev-parse --short $after) &&
30+
sed -e "s/^index .*/index $before..$after 100644/" expected >exp &&
2631
git config --bool diff.suppressBlankEmpty true &&
2732
git diff f > actual &&
2833
test_cmp exp actual &&

0 commit comments

Comments
 (0)