diff options
author | 2021-05-31 16:56:17 +0000 | |
---|---|---|
committer | 2021-06-02 10:01:54 +0900 | |
commit | 0221eb86782bdd2cbbe9d6223d7ac9bcb61961b1 (patch) | |
tree | 373491f064fdbea4de26dad5789b5bd954d90fba /t/helper | |
parent | t4202: split testcase for invalid HEAD symref and HEAD hash (diff) | |
download | tgif-0221eb86782bdd2cbbe9d6223d7ac9bcb61961b1.tar.xz |
t/helper/ref-store: initialize oid in resolve-ref
This will print $ZERO_OID when asking for a non-existent ref from the
test-helper.
Since resolve-ref provides direct access to refs_resolve_ref_unsafe(), it
provides a reliable mechanism for accessing REFNAME, while avoiding the implicit
resolution to refs/heads/REFNAME.
Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/helper')
-rw-r--r-- | t/helper/test-ref-store.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/t/helper/test-ref-store.c b/t/helper/test-ref-store.c index bba5f841c6..b314b81a45 100644 --- a/t/helper/test-ref-store.c +++ b/t/helper/test-ref-store.c @@ -118,7 +118,7 @@ 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) { - struct object_id oid; + struct object_id oid = *null_oid(); const char *refname = notnull(*argv++, "refname"); int resolve_flags = arg_flags(*argv++, "resolve-flags"); int flags; |