Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2018-03-25 22:20:46 +0300
committerJunio C Hamano <gitster@pobox.com>2018-03-27 01:10:48 +0300
commitd47125d4ecb451a666849d97382b5cd0248cba3a (patch)
tree0b50afe900368956d0278d366517a1c279f498a2 /t/t1011-read-tree-sparse-checkout.sh
parent90bbd502d54fe920356fa9278055dc9c9bfe9a56 (diff)
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>
Diffstat (limited to 't/t1011-read-tree-sparse-checkout.sh')
-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 &&