Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHan-Wen Nienhuys <hanwen@google.com>2021-12-21 16:15:00 +0300
committerJunio C Hamano <gitster@pobox.com>2021-12-22 09:00:01 +0300
commit57eb3681449d7b4703bb124e482440759724419f (patch)
treea1c82d81800b0edf2858761a18d86b176f5eeaa4 /t/helper/test-ref-store.c
parent597af311a2899bfd6640b9b107622c5795d5f998 (diff)
test-ref-store: print hash algorithm
This provides a better error message in case SHA256 was inadvertently switched on through the environment. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper/test-ref-store.c')
-rw-r--r--t/helper/test-ref-store.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/t/helper/test-ref-store.c b/t/helper/test-ref-store.c
index 24dd4bec08..3e4ddaee70 100644
--- a/t/helper/test-ref-store.c
+++ b/t/helper/test-ref-store.c
@@ -269,7 +269,7 @@ static int cmd_delete_ref(struct ref_store *refs, const char **argv)
struct object_id old_oid;
if (get_oid_hex(sha1_buf, &old_oid))
- die("not sha-1");
+ die("cannot parse %s as %s", sha1_buf, the_hash_algo->name);
return refs_delete_ref(refs, msg, refname, &old_oid, flags);
}
@@ -284,9 +284,10 @@ static int cmd_update_ref(struct ref_store *refs, const char **argv)
struct object_id old_oid;
struct object_id new_oid;
- if (get_oid_hex(old_sha1_buf, &old_oid) ||
- get_oid_hex(new_sha1_buf, &new_oid))
- die("not sha-1");
+ if (get_oid_hex(old_sha1_buf, &old_oid))
+ die("cannot parse %s as %s", old_sha1_buf, the_hash_algo->name);
+ if (get_oid_hex(new_sha1_buf, &new_oid))
+ die("cannot parse %s as %s", new_sha1_buf, the_hash_algo->name);
return refs_update_ref(refs, msg, refname,
&new_oid, &old_oid,