t1302: expect repo format version 1 for SHA-256

When using SHA-256, we need to take advantage of the extensions section
in the config file, so we need to use repository format version 1.
Update the test to look for the correct value.

Note that test_oid produces a value without a trailing newline, so use
echo to ensure we print a trailing newline to compare it correctly
against the actual results.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
brian m. carlson 2020-05-25 19:59:13 +00:00 committed by Junio C Hamano
parent 88a09a557c
commit 059d8066f8
1 changed files with 5 additions and 1 deletions

View File

@ -8,6 +8,10 @@ test_description='Test repository version check'
. ./test-lib.sh

test_expect_success 'setup' '
test_oid_cache <<-\EOF &&
version sha1:0
version sha256:1
EOF
cat >test.patch <<-\EOF &&
diff --git a/test.txt b/test.txt
new file mode 100644
@ -23,7 +27,7 @@ test_expect_success 'setup' '
'

test_expect_success 'gitdir selection on normal repos' '
echo 0 >expect &&
echo $(test_oid version) >expect &&
git config core.repositoryformatversion >actual &&
git -C test config core.repositoryformatversion >actual2 &&
test_cmp expect actual &&