diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2017-10-15 22:07:09 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-10-16 11:05:51 +0900 |
commit | 49e61479be913f67e66bb3fdf8de9475c41b58bd (patch) | |
tree | d11f8d92c1cd473fdd7a70661fda2e8637bfe621 /t/helper | |
parent | worktree: convert struct worktree to object_id (diff) | |
download | tgif-49e61479be913f67e66bb3fdf8de9475c41b58bd.tar.xz |
refs: convert resolve_ref_unsafe to struct object_id
Convert resolve_ref_unsafe to take a pointer to struct object_id by
converting one remaining caller to use struct object_id, removing the
temporary NULL pointer check in expand_ref, converting the declaration
and definition, and applying the following semantic patch:
@@
expression E1, E2, E3, E4;
@@
- resolve_ref_unsafe(E1, E2, E3.hash, E4)
+ resolve_ref_unsafe(E1, E2, &E3, E4)
@@
expression E1, E2, E3, E4;
@@
- resolve_ref_unsafe(E1, E2, E3->hash, E4)
+ resolve_ref_unsafe(E1, E2, E3, E4)
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper')
-rw-r--r-- | t/helper/test-ref-store.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/t/helper/test-ref-store.c b/t/helper/test-ref-store.c index cea3285ada..d846c88ed2 100644 --- a/t/helper/test-ref-store.c +++ b/t/helper/test-ref-store.c @@ -127,15 +127,15 @@ static int cmd_for_each_ref(struct ref_store *refs, const char **argv) static int cmd_resolve_ref(struct ref_store *refs, const char **argv) { - unsigned char sha1[20]; + struct object_id oid; const char *refname = notnull(*argv++, "refname"); int resolve_flags = arg_flags(*argv++, "resolve-flags"); int flags; const char *ref; ref = refs_resolve_ref_unsafe(refs, refname, resolve_flags, - sha1, &flags); - printf("%s %s 0x%x\n", sha1_to_hex(sha1), ref, flags); + &oid, &flags); + printf("%s %s 0x%x\n", oid_to_hex(&oid), ref, flags); return ref ? 0 : 1; } |