aboutsummaryrefslogtreecommitdiffstats
path: root/remote-curl.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2025-07-01 21:22:30 +0000
committerJunio C Hamano <gitster@pobox.com>2025-07-01 14:58:24 -0700
commit667d251a04c1dd769fb5a71bbe94d6d15ae594f1 (patch)
tree46195a62ed6dd38d4046bd4a4edfb569c2aa3eb9 /remote-curl.c
parentbuiltin: use default hash when outside a repository (diff)
downloadgit-667d251a04c1dd769fb5a71bbe94d6d15ae594f1.tar.gz
git-667d251a04c1dd769fb5a71bbe94d6d15ae594f1.zip
Use legacy hash for legacy formats
We have a large variety of data formats and protocols where no hash algorithm was defined and the default was assumed to always be SHA-1. Instead of explicitly stating SHA-1, let's use the constant to represent the legacy hash algorithm (which is still SHA-1) so that it's clear for documentary purposes that it's a legacy fallback option and not an intentional choice to use SHA-1. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'remote-curl.c')
-rw-r--r--remote-curl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/remote-curl.c b/remote-curl.c
index b8bc3a80cf..84f4694780 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -285,7 +285,7 @@ static const struct git_hash_algo *detect_hash_algo(struct discovery *heads)
* back to SHA1, which may or may not be correct.
*/
if (!p)
- return &hash_algos[GIT_HASH_SHA1];
+ return &hash_algos[GIT_HASH_SHA1_LEGACY];
algo = hash_algo_by_length((p - heads->buf) / 2);
if (algo == GIT_HASH_UNKNOWN)