summaryrefslogtreecommitdiff
path: root/revision.c
diff options
context:
space:
mode:
authorLibravatar brian m. carlson <sandals@crustytoothpaste.net>2017-05-06 22:10:38 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-05-08 15:12:58 +0900
commitc251c83df276dc0bff4d008433268ad59b7a8df2 (patch)
treed02e5ce126a0b10e1213b56278aff74a3e2a4b0f /revision.c
parenttree: convert parse_tree_indirect to struct object_id (diff)
downloadtgif-c251c83df276dc0bff4d008433268ad59b7a8df2.tar.xz
object: convert parse_object* to take struct object_id
Make parse_object, parse_object_or_die, and parse_object_buffer take a pointer to struct object_id. Remove the temporary variables inserted earlier, since they are no longer necessary. Transform all of the callers using the following semantic patch: @@ expression E1; @@ - parse_object(E1.hash) + parse_object(&E1) @@ expression E1; @@ - parse_object(E1->hash) + parse_object(E1) @@ expression E1, E2; @@ - parse_object_or_die(E1.hash, E2) + parse_object_or_die(&E1, E2) @@ expression E1, E2; @@ - parse_object_or_die(E1->hash, E2) + parse_object_or_die(E1, E2) @@ expression E1, E2, E3, E4, E5; @@ - parse_object_buffer(E1.hash, E2, E3, E4, E5) + parse_object_buffer(&E1, E2, E3, E4, E5) @@ expression E1, E2, E3, E4, E5; @@ - parse_object_buffer(E1->hash, E2, E3, E4, E5) + parse_object_buffer(E1, E2, E3, E4, E5) Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/revision.c b/revision.c
index 80f74bb7b4..64e67e017f 100644
--- a/revision.c
+++ b/revision.c
@@ -181,7 +181,7 @@ void add_head_to_pending(struct rev_info *revs)
struct object *obj;
if (get_oid("HEAD", &oid))
return;
- obj = parse_object(oid.hash);
+ obj = parse_object(&oid);
if (!obj)
return;
add_pending_object(revs, obj, "HEAD");
@@ -193,7 +193,7 @@ static struct object *get_reference(struct rev_info *revs, const char *name,
{
struct object *object;
- object = parse_object(oid->hash);
+ object = parse_object(oid);
if (!object) {
if (revs->ignore_missing)
return object;
@@ -228,7 +228,7 @@ static struct commit *handle_commit(struct rev_info *revs,
add_pending_object(revs, object, tag->tag);
if (!tag->tagged)
die("bad tag");
- object = parse_object(tag->tagged->oid.hash);
+ object = parse_object(&tag->tagged->oid);
if (!object) {
if (flags & UNINTERESTING)
return NULL;
@@ -1200,7 +1200,7 @@ static void handle_one_reflog_commit(struct object_id *oid, void *cb_data)
{
struct all_refs_cb *cb = cb_data;
if (!is_null_oid(oid)) {
- struct object *o = parse_object(oid->hash);
+ struct object *o = parse_object(oid);
if (o) {
o->flags |= cb->all_flags;
/* ??? CMDLINEFLAGS ??? */
@@ -1479,8 +1479,8 @@ int handle_revision_arg(const char *arg_, struct rev_info *revs, int flags, unsi
verify_non_filename(revs->prefix, arg);
}
- a_obj = parse_object(from_oid.hash);
- b_obj = parse_object(oid.hash);
+ a_obj = parse_object(&from_oid);
+ b_obj = parse_object(&oid);
if (!a_obj || !b_obj) {
missing:
if (revs->ignore_missing)