aboutsummaryrefslogtreecommitdiff
path: root/sha1_name.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2017-10-15 22:06:57 +0000
committerJunio C Hamano <gitster@pobox.com>2017-10-16 11:05:51 +0900
commitcca5fa6406046c19ab5a8117fe71bf4402c00d88 (patch)
treeb7305cc09752a86366cb4695cd504adec207e022 /sha1_name.c
parent34c290a6fc8b1f6705d2646d726df2260927da0f (diff)
downloadgit-cca5fa6406046c19ab5a8117fe71bf4402c00d88.tar.gz
git-cca5fa6406046c19ab5a8117fe71bf4402c00d88.tar.xz
refs: convert dwim_ref and expand_ref to struct object_id
All of the callers of these functions just pass the hash member of a struct object_id, so convert them to use a pointer to struct object_id directly. Insert a check for NULL in expand_ref on a temporary basis; this check can be removed when resolve_ref_unsafe is converted as well. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sha1_name.c')
-rw-r--r--sha1_name.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sha1_name.c b/sha1_name.c
index c7c5ab376..d8ff83175 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -603,7 +603,7 @@ static int get_oid_basic(const char *str, int len, struct object_id *oid,
if (len == GIT_SHA1_HEXSZ && !get_oid_hex(str, oid)) {
if (warn_ambiguous_refs && warn_on_object_refname_ambiguity) {
- refs_found = dwim_ref(str, len, tmp_oid.hash, &real_ref);
+ refs_found = dwim_ref(str, len, &tmp_oid, &real_ref);
if (refs_found > 0) {
warning(warn_msg, len, str);
if (advice_object_name_warning)
@@ -654,11 +654,11 @@ static int get_oid_basic(const char *str, int len, struct object_id *oid,
if (!len && reflog_len)
/* allow "@{...}" to mean the current branch reflog */
- refs_found = dwim_ref("HEAD", 4, oid->hash, &real_ref);
+ refs_found = dwim_ref("HEAD", 4, oid, &real_ref);
else if (reflog_len)
refs_found = dwim_log(str, len, oid->hash, &real_ref);
else
- refs_found = dwim_ref(str, len, oid->hash, &real_ref);
+ refs_found = dwim_ref(str, len, oid, &real_ref);
if (!refs_found)
return -1;