diff options
| author | brian m. carlson <sandals@crustytoothpaste.net> | 2017-10-15 22:07:02 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2017-10-16 11:05:51 +0900 |
| commit | b420d90980a31246836680b68ca15e0239a8b696 (patch) | |
| tree | 2e455c17799c655f6f79f8d31a50deec0dae04ac /builtin | |
| parent | 188960b4d68e0b77e31481592b86306a9ce37632 (diff) | |
| download | 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 'builtin')
| -rw-r--r-- | builtin/describe.c | 2 | ||||
| -rw-r--r-- | builtin/pack-objects.c | 4 | ||||
| -rw-r--r-- | builtin/show-ref.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/builtin/describe.c b/builtin/describe.c index 29075dbd0f..352f8821fd 100644 --- a/builtin/describe.c +++ b/builtin/describe.c @@ -181,7 +181,7 @@ static int get_name(const char *path, const struct object_id *oid, int flag, voi } /* Is it annotated? */ - if (!peel_ref(path, peeled.hash)) { + if (!peel_ref(path, &peeled)) { is_annotated = !!oidcmp(oid, &peeled); } else { oidcpy(&peeled, oid); diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index 9c6b224973..631de28761 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -562,7 +562,7 @@ static int mark_tagged(const char *path, const struct object_id *oid, int flag, if (entry) entry->tagged = 1; - if (!peel_ref(path, peeled.hash)) { + if (!peel_ref(path, &peeled)) { entry = packlist_find(&to_pack, peeled.hash, NULL); if (entry) entry->tagged = 1; @@ -2371,7 +2371,7 @@ static int add_ref_tag(const char *path, const struct object_id *oid, int flag, struct object_id peeled; if (starts_with(path, "refs/tags/") && /* is a tag? */ - !peel_ref(path, peeled.hash) && /* peelable? */ + !peel_ref(path, &peeled) && /* peelable? */ packlist_find(&to_pack, peeled.hash, NULL)) /* object packed? */ add_tag_chain(oid); return 0; diff --git a/builtin/show-ref.c b/builtin/show-ref.c index cbb8cfc7d2..41e5e71cad 100644 --- a/builtin/show-ref.c +++ b/builtin/show-ref.c @@ -38,7 +38,7 @@ static void show_one(const char *refname, const struct object_id *oid) if (!deref_tags) return; - if (!peel_ref(refname, peeled.hash)) { + if (!peel_ref(refname, &peeled)) { hex = find_unique_abbrev(peeled.hash, abbrev); printf("%s %s^{}\n", hex, refname); } |
