diff options
| author | brian m. carlson <sandals@crustytoothpaste.net> | 2025-07-01 21:22:30 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-07-01 14:58:24 -0700 |
| commit | 667d251a04c1dd769fb5a71bbe94d6d15ae594f1 (patch) | |
| tree | 46195a62ed6dd38d4046bd4a4edfb569c2aa3eb9 /fetch-pack.c | |
| parent | builtin: use default hash when outside a repository (diff) | |
| download | git-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 'fetch-pack.c')
| -rw-r--r-- | fetch-pack.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fetch-pack.c b/fetch-pack.c index fa4231fee7..95f66ffc1d 100644 --- a/fetch-pack.c +++ b/fetch-pack.c @@ -1342,7 +1342,7 @@ static void write_fetch_command_and_capabilities(struct strbuf *req_buf, die(_("mismatched algorithms: client %s; server %s"), the_hash_algo->name, hash_name); packet_buf_write(req_buf, "object-format=%s", the_hash_algo->name); - } else if (hash_algo_by_ptr(the_hash_algo) != GIT_HASH_SHA1) { + } else if (hash_algo_by_ptr(the_hash_algo) != GIT_HASH_SHA1_LEGACY) { die(_("the server does not support algorithm '%s'"), the_hash_algo->name); } |
