aboutsummaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2017-10-15 22:07:02 +0000
committerJunio C Hamano <gitster@pobox.com>2017-10-16 11:05:51 +0900
commitb420d90980a31246836680b68ca15e0239a8b696 (patch)
tree2e455c17799c655f6f79f8d31a50deec0dae04ac /refs.c
parent188960b4d68e0b77e31481592b86306a9ce37632 (diff)
downloadgit-b420d90980a31246836680b68ca15e0239a8b696.tar.gz
git-b420d90980a31246836680b68ca15e0239a8b696.tar.xz
refs: convert peel_ref to struct object_id
Convert peel_ref (and its corresponding backend) to struct object_id. This transformation was done with an update to the declaration, definition, comments, and test helper and the following semantic patch: @@ expression E1, E2; @@ - peel_ref(E1, E2.hash) + peel_ref(E1, &E2) @@ expression E1, E2; @@ - peel_ref(E1, E2->hash) + peel_ref(E1, E2) Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/refs.c b/refs.c
index ecb43a113..f8a2d9866 100644
--- a/refs.c
+++ b/refs.c
@@ -1697,7 +1697,7 @@ int refs_pack_refs(struct ref_store *refs, unsigned int flags)
}
int refs_peel_ref(struct ref_store *refs, const char *refname,
- unsigned char *sha1)
+ struct object_id *oid)
{
int flag;
struct object_id base;
@@ -1707,7 +1707,7 @@ int refs_peel_ref(struct ref_store *refs, const char *refname,
if (ref_iterator_peel(current_ref_iter, &peeled))
return -1;
- hashcpy(sha1, peeled.hash);
+ oidcpy(oid, &peeled);
return 0;
}
@@ -1715,12 +1715,12 @@ int refs_peel_ref(struct ref_store *refs, const char *refname,
RESOLVE_REF_READING, &base, &flag))
return -1;
- return peel_object(base.hash, sha1);
+ return peel_object(base.hash, oid->hash);
}
-int peel_ref(const char *refname, unsigned char *sha1)
+int peel_ref(const char *refname, struct object_id *oid)
{
- return refs_peel_ref(get_main_ref_store(), refname, sha1);
+ return refs_peel_ref(get_main_ref_store(), refname, oid);
}
int refs_create_symref(struct ref_store *refs,