]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t1302: expect repo format version 1 for SHA-256
authorbrian m. carlson <sandals@crustytoothpaste.net>
Mon, 25 May 2020 19:59:13 +0000 (19:59 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 27 May 2020 17:07:07 +0000 (10:07 -0700)
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>
t/t1302-repo-version.sh

index ce4cff13bbced58add641a463321f36673121fd7..d60c042ce88b5306b8c32f6b3d928338f6720168 100755 (executable)
@@ -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 &&