summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar brian m. carlson <sandals@crustytoothpaste.net>2018-03-25 19:20:46 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-03-26 15:10:48 -0700
commitd47125d4ecb451a666849d97382b5cd0248cba3a (patch)
tree0b50afe900368956d0278d366517a1c279f498a2
parentSync with Git 2.16.3 (diff)
downloadtgif-d47125d4ecb451a666849d97382b5cd0248cba3a.tar.xz
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>
-rwxr-xr-xt/t1011-read-tree-sparse-checkout.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/t/t1011-read-tree-sparse-checkout.sh b/t/t1011-read-tree-sparse-checkout.sh
index c167f606ca..0c6f48f302 100755
--- a/t/t1011-read-tree-sparse-checkout.sh
+++ b/t/t1011-read-tree-sparse-checkout.sh
@@ -15,8 +15,11 @@ test_description='sparse checkout tests
. "$TEST_DIRECTORY"/lib-read-tree.sh
test_expect_success 'setup' '
+ test_commit init &&
+ echo modified >>init.t &&
+
cat >expected <<-EOF &&
- 100644 77f0ba1734ed79d12881f81b36ee134de6a3327b 0 init.t
+ 100644 $(git hash-object init.t) 0 init.t
100644 $EMPTY_BLOB 0 sub/added
100644 $EMPTY_BLOB 0 sub/addedtoo
100644 $EMPTY_BLOB 0 subsub/added
@@ -28,8 +31,6 @@ test_expect_success 'setup' '
H subsub/added
EOF
- test_commit init &&
- echo modified >>init.t &&
mkdir sub subsub &&
touch sub/added sub/addedtoo subsub/added &&
git add init.t sub/added sub/addedtoo subsub/added &&