]> git.ipfire.org Git - thirdparty/git.git/commit
builtin: use default hash when outside a repository
authorbrian m. carlson <sandals@crustytoothpaste.net>
Tue, 1 Jul 2025 21:22:29 +0000 (21:22 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 1 Jul 2025 21:58:24 +0000 (14:58 -0700)
commitdc9c16c2fc8222364277696cb4d70782281d3c06
treea0f7dc4e04712c34e961b7b6a354c57be86d7a74
parent1f68f3da877a91fefd6cc84b79986af2ef73d21e
builtin: use default hash when outside a repository

We have some commands that can operate inside or outside a repository.
If we're operating outside a repository, we clearly cannot use the
repository's hash algorithm as a default since it doesn't exist, so
instead, let's pick the default instead of specifically SHA-1.  Right
now this results in no functional change since the default is SHA-1, but
that may change in the future.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/apply.c
builtin/diff.c
builtin/hash-object.c
builtin/index-pack.c
builtin/ls-remote.c
builtin/patch-id.c
builtin/shortlog.c
builtin/show-index.c