summaryrefslogtreecommitdiff
path: root/walker.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 /walker.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 'walker.c')
-rw-r--r--walker.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/walker.c b/walker.c
index ce2f57abe7..7d1ee30b8e 100644
--- a/walker.c
+++ b/walker.c
@@ -78,7 +78,7 @@ static int process_commit(struct walker *walker, struct commit *commit)
if (commit->object.flags & COMPLETE)
return 0;
- hashcpy(current_commit_sha1, commit->object.sha1);
+ hashcpy(current_commit_sha1, get_object_hash(commit->object));
walker_say(walker, "walk %s\n", sha1_to_hex(commit->object.sha1));
@@ -146,7 +146,7 @@ static int process(struct walker *walker, struct object *obj)
else {
if (obj->flags & COMPLETE)
return 0;
- walker->prefetch(walker, obj->sha1);
+ walker->prefetch(walker, get_object_hash(*obj));
}
object_list_insert(obj, process_queue_end);
@@ -170,13 +170,13 @@ static int loop(struct walker *walker)
* the queue because we needed to fetch it first.
*/
if (! (obj->flags & TO_SCAN)) {
- if (walker->fetch(walker, obj->sha1)) {
+ if (walker->fetch(walker, get_object_hash(*obj))) {
report_missing(obj);
return -1;
}
}
if (!obj->type)
- parse_object(obj->sha1);
+ parse_object(get_object_hash(*obj));
if (process_object(walker, obj))
return -1;
}