summaryrefslogtreecommitdiff
path: root/upload-pack.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2015-11-10 02:22:27 +0000
committerJeff King <peff@peff.net>2015-11-20 08:02:05 -0500
commit7999b2cf772956466baa8925491d6fb1b0963292 (patch)
tree34a3bf75c3cdc621d732107f53181ff28c0550a4 /upload-pack.c
parent3c4270107fec2c1d85b7b1a6f8b0aeebf3193b28 (diff)
downloadgit-7999b2cf772956466baa8925491d6fb1b0963292.tar.gz
Add several uses of get_object_hash.
Convert most instances where the sha1 member of struct object is dereferenced to use get_object_hash. Most instances that are passed to functions that have versions taking struct object_id, such as get_sha1_hex/get_oid_hex, or instances that can be trivially converted to use struct object_id instead, are not converted. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Jeff King <peff@peff.net>
Diffstat (limited to 'upload-pack.c')
-rw-r--r--upload-pack.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/upload-pack.c b/upload-pack.c
index 08efb1de7b..c6b05c6017 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -324,7 +324,7 @@ static int reachable(struct commit *want)
break;
}
if (!commit->object.parsed)
- parse_object(commit->object.sha1);
+ parse_object(get_object_hash(commit->object));
if (commit->object.flags & REACHABLE)
continue;
commit->object.flags |= REACHABLE;
@@ -647,7 +647,7 @@ static void receive_needs(void)
if (!(object->flags & (CLIENT_SHALLOW|NOT_SHALLOW))) {
packet_write(1, "shallow %s",
sha1_to_hex(object->sha1));
- register_shallow(object->sha1);
+ register_shallow(get_object_hash(*object));
shallow_nr++;
}
result = result->next;
@@ -661,7 +661,7 @@ static void receive_needs(void)
sha1_to_hex(object->sha1));
object->flags &= ~CLIENT_SHALLOW;
/* make sure the real parents are parsed */
- unregister_shallow(object->sha1);
+ unregister_shallow(get_object_hash(*object));
object->parsed = 0;
parse_commit_or_die((struct commit *)object);
parents = ((struct commit *)object)->parents;
@@ -673,14 +673,14 @@ static void receive_needs(void)
add_object_array(object, NULL, &extra_edge_obj);
}
/* make sure commit traversal conforms to client */
- register_shallow(object->sha1);
+ register_shallow(get_object_hash(*object));
}
packet_flush(1);
} else
if (shallows.nr > 0) {
int i;
for (i = 0; i < shallows.nr; i++)
- register_shallow(shallows.objects[i].item->sha1);
+ register_shallow(get_object_hash(*shallows.objects[i].item));
}
shallow_nr += shallows.nr;