diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2017-10-16 00:07:02 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-10-16 04:05:51 +0200 |
commit | b420d90980a31246836680b68ca15e0239a8b696 (patch) | |
tree | 2e455c17799c655f6f79f8d31a50deec0dae04ac /refs.c | |
parent | builtin/pack-objects: convert to struct object_id (diff) | |
download | git-b420d90980a31246836680b68ca15e0239a8b696.tar.xz git-b420d90980a31246836680b68ca15e0239a8b696.zip |
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.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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, |