Skip to content

Commit 321f7f4

Browse files
committed
Merge branch 'hn/test-ref-store-show-hash-algo'
Debugging support for refs API. * hn/test-ref-store-show-hash-algo: test-ref-store: print hash algorithm
2 parents 98ab07a + 57eb368 commit 321f7f4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

t/helper/test-ref-store.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ static int cmd_delete_ref(struct ref_store *refs, const char **argv)
269269
struct object_id old_oid;
270270

271271
if (get_oid_hex(sha1_buf, &old_oid))
272-
die("not sha-1");
272+
die("cannot parse %s as %s", sha1_buf, the_hash_algo->name);
273273

274274
return refs_delete_ref(refs, msg, refname, &old_oid, flags);
275275
}
@@ -284,9 +284,10 @@ static int cmd_update_ref(struct ref_store *refs, const char **argv)
284284
struct object_id old_oid;
285285
struct object_id new_oid;
286286

287-
if (get_oid_hex(old_sha1_buf, &old_oid) ||
288-
get_oid_hex(new_sha1_buf, &new_oid))
289-
die("not sha-1");
287+
if (get_oid_hex(old_sha1_buf, &old_oid))
288+
die("cannot parse %s as %s", old_sha1_buf, the_hash_algo->name);
289+
if (get_oid_hex(new_sha1_buf, &new_oid))
290+
die("cannot parse %s as %s", new_sha1_buf, the_hash_algo->name);
290291

291292
return refs_update_ref(refs, msg, refname,
292293
&new_oid, &old_oid,

0 commit comments

Comments
 (0)