mirror of
https://github.com/git/git.git
synced 2026-01-10 10:13:33 +00:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
1f68f3da87
commit
dc9c16c2fc
@@ -112,7 +112,7 @@ int cmd_ls_remote(int argc,
|
||||
* depending on what object hash the remote uses.
|
||||
*/
|
||||
if (!the_repository->hash_algo)
|
||||
repo_set_hash_algo(the_repository, GIT_HASH_SHA1);
|
||||
repo_set_hash_algo(the_repository, GIT_HASH_DEFAULT);
|
||||
|
||||
packet_trace_identity("ls-remote");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user