Skip to content

Commit 0221eb8

Browse files
hanwengitster
authored andcommitted
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>
1 parent 230356b commit 0221eb8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/helper/test-ref-store.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static int cmd_for_each_ref(struct ref_store *refs, const char **argv)
118118

119119
static int cmd_resolve_ref(struct ref_store *refs, const char **argv)
120120
{
121-
struct object_id oid;
121+
struct object_id oid = *null_oid();
122122
const char *refname = notnull(*argv++, "refname");
123123
int resolve_flags = arg_flags(*argv++, "resolve-flags");
124124
int flags;

0 commit comments

Comments
 (0)