summaryrefslogtreecommitdiff
path: root/t/helper
diff options
context:
space:
mode:
authorHan-Wen Nienhuys <hanwen@google.com>2021-05-31 16:56:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-06-02 01:01:54 (GMT)
commit0221eb86782bdd2cbbe9d6223d7ac9bcb61961b1 (patch)
tree373491f064fdbea4de26dad5789b5bd954d90fba /t/helper
parent230356ba704fc36e848e94b13c5b92acfa4c6fc6 (diff)
downloadgit-0221eb86782bdd2cbbe9d6223d7ac9bcb61961b1.zip
git-0221eb86782bdd2cbbe9d6223d7ac9bcb61961b1.tar.gz
git-0221eb86782bdd2cbbe9d6223d7ac9bcb61961b1.tar.bz2
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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/helper/test-ref-store.c b/t/helper/test-ref-store.c
index bba5f84..b314b81 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;