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>
This commit is contained in:
brian m. carlson
2017-10-15 22:07:02 +00:00
committed by Junio C Hamano
parent 188960b4d6
commit b420d90980
7 changed files with 17 additions and 17 deletions

8
refs.h
View File

@@ -114,14 +114,14 @@ extern int refs_init_db(struct strbuf *err);
/*
* If refname is a non-symbolic reference that refers to a tag object,
* and the tag can be (recursively) dereferenced to a non-tag object,
* store the SHA1 of the referred-to object to sha1 and return 0. If
* any of these conditions are not met, return a non-zero value.
* store the object ID of the referred-to object to oid and return 0.
* If any of these conditions are not met, return a non-zero value.
* Symbolic references are considered unpeelable, even if they
* ultimately resolve to a peelable tag.
*/
int refs_peel_ref(struct ref_store *refs, const char *refname,
unsigned char *sha1);
int peel_ref(const char *refname, unsigned char *sha1);
struct object_id *oid);
int peel_ref(const char *refname, struct object_id *oid);
/**
* Resolve refname in the nested "gitlink" repository in the specified