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>
This commit is contained in:
parent
230356ba70
commit
0221eb8678
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user