Skip to content

Commit d47125d

Browse files
bk2204gitster
authored andcommitted
t1011: abstract away SHA-1-specific constants
Adjust the test so that it computes the expected hash value dynamically instead of relying on a hard-coded hash. Hoist some code earlier in the test to make this possible. Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 90bbd50 commit d47125d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

t/t1011-read-tree-sparse-checkout.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@ test_description='sparse checkout tests
1515
. "$TEST_DIRECTORY"/lib-read-tree.sh
1616

1717
test_expect_success 'setup' '
18+
test_commit init &&
19+
echo modified >>init.t &&
20+
1821
cat >expected <<-EOF &&
19-
100644 77f0ba1734ed79d12881f81b36ee134de6a3327b 0 init.t
22+
100644 $(git hash-object init.t) 0 init.t
2023
100644 $EMPTY_BLOB 0 sub/added
2124
100644 $EMPTY_BLOB 0 sub/addedtoo
2225
100644 $EMPTY_BLOB 0 subsub/added
@@ -28,8 +31,6 @@ test_expect_success 'setup' '
2831
H subsub/added
2932
EOF
3033
31-
test_commit init &&
32-
echo modified >>init.t &&
3334
mkdir sub subsub &&
3435
touch sub/added sub/addedtoo subsub/added &&
3536
git add init.t sub/added sub/addedtoo subsub/added &&

0 commit comments

Comments
 (0)