mirror of
https://github.com/git/git.git
synced 2026-02-28 18:48:50 +00:00
conversion: don't crash when no destination algo
When we set up a repository that doesn't have a compatibility hash algorithm, we set the destination algorithm object to NULL. In such a case, we want to silently do nothing instead of crashing, so simply treat the operation as a no-op and copy the object ID. 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
13ecc93842
commit
9c317a68b7
@@ -23,7 +23,7 @@ int repo_oid_to_algop(struct repository *repo, const struct object_id *src,
|
||||
const struct git_hash_algo *from =
|
||||
src->algo ? &hash_algos[src->algo] : repo->hash_algo;
|
||||
|
||||
if (from == to) {
|
||||
if (from == to || !to) {
|
||||
if (src != dest)
|
||||
oidcpy(dest, src);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user