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 <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
brian m. carlson committed
Mar 25, 2018 at 19:20 UTC
d47125d4ecb451a666849d97382b5cd0248cba3a
1 file changed
+4
-3
t/t1011-read-tree-sparse-checkout.sh
+4
-3
@@ -15,8 +15,11 @@ test_description='sparse checkout tests
15
. "$TEST_DIRECTORY"/lib-read-tree.sh
16
17
test_expect_success 'setup' '
18
+ test_commit init &&
19
+ echo modified >>init.t &&
20
+
21
cat >expected <<-EOF &&
19
- 100644 77f0ba1734ed79d12881f81b36ee134de6a3327b 0 init.t
22
+ 100644 $(git hash-object init.t) 0 init.t
23
100644 $EMPTY_BLOB 0 sub/added
24
100644 $EMPTY_BLOB 0 sub/addedtoo
25
100644 $EMPTY_BLOB 0 subsub/added
@@ -28,8 +31,6 @@ test_expect_success 'setup' '
31
H subsub/added
32
EOF
33
31
- test_commit init &&
32
- echo modified >>init.t &&
34
mkdir sub subsub &&
35
touch sub/added sub/addedtoo subsub/added &&
36
git add init.t sub/added sub/addedtoo subsub/added &&