summaryrefslogtreecommitdiffstats
path: root/walker.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2024-10-25 09:03:42 +0200
committerTaylor Blau <me@ttaylorr.com>2024-10-25 23:35:46 +0200
commit0af861e0c8d7b7c6135bfc688be13370ac2c9468 (patch)
tree860562879ac792faf3149a7b269da3971d1e23e6 /walker.c
parentpackfile: warn people away from parse_packed_git() (diff)
downloadgit-0af861e0c8d7b7c6135bfc688be13370ac2c9468.tar.xz
git-0af861e0c8d7b7c6135bfc688be13370ac2c9468.zip
http-walker: use object_id instead of bare hash
We long ago switched most code to using object_id structs instead of bare "unsigned char *" hashes. This gives us more type safety from the compiler, and generally makes it easier to understand what we expect in each parameter. But the dumb-http code has lagged behind. And indeed, the whole "walker" subsystem interface has the same problem, though http-walker is the only user left. So let's update the walker interface to pass object_id structs (which we already have anyway at all call sites!), and likewise use those within the http-walker methods that it calls. This cleans up the dumb-http code a bit, but will also let us fix a few more commonly used helper functions. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Taylor Blau <me@ttaylorr.com>
Diffstat (limited to 'walker.c')
-rw-r--r--walker.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/walker.c b/walker.c
index 807a7a3881..5ea7e5b392 100644
--- a/walker.c
+++ b/walker.c
@@ -157,7 +157,7 @@ static int process(struct walker *walker, struct object *obj)
else {
if (obj->flags & COMPLETE)
return 0;
- walker->prefetch(walker, obj->oid.hash);
+ walker->prefetch(walker, &obj->oid);
}
object_list_insert(obj, process_queue_end);
@@ -186,7 +186,7 @@ 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->oid.hash)) {
+ if (walker->fetch(walker, &obj->oid)) {
stop_progress(&progress);
report_missing(obj);
return -1;