]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t1007: choose the built-in hash outside of a repo
authorbrian m. carlson <sandals@crustytoothpaste.net>
Fri, 20 Jun 2025 01:19:39 +0000 (01:19 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 20 Jun 2025 14:17:37 +0000 (07:17 -0700)
Right now, the built-in default hash is always SHA-1, but that will
change in a future commit.  Instead of assuming that operating outside
of a repository will always use SHA-1, simply ask test_oid for the
built-in hash instead, which will always be correct.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1007-hash-object.sh

index dbbe9fb0d4b19b6f7f419736f2c1d01a8316f97f..b4e8d04885b16373e315499a4220ceeaa3cbc027 100755 (executable)
@@ -252,9 +252,9 @@ test_expect_success '--literally complains about non-standard types' '
        test_must_fail git hash-object -t bogus --literally --stdin
 '
 
-test_expect_success '--stdin outside of repository (uses SHA-1)' '
+test_expect_success '--stdin outside of repository (uses default hash)' '
        nongit git hash-object --stdin <hello >actual &&
-       echo "$(test_oid --hash=sha1 hello)" >expect &&
+       echo "$(test_oid --hash=builtin hello)" >expect &&
        test_cmp expect actual
 '