list-objects: reduce one argument in mark_edges_uninteresting

mark_edges_uninteresting() is always called with this form mark_edges_uninteresting(revs->commits, revs, ...); Remove the first argument and let mark_edges_uninteresting figure that out by itself. It helps answer the question "are this commit list and revs related in any way?" when looking at mark_edges_uninteresting implementation. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nguyễn Thái Ngọc Duy committed Aug 16, 2013 at 16:52 UTC e76a5fb4593b80cdc9dda66809ae910e86b6ffbe
6 files changed +8 -9
bisect.c
+1 -1
@@ -624,7 +624,7 @@ static void bisect_common(struct rev_info *revs)
624 if (prepare_revision_walk(revs))
625 die("revision walk setup failed");
626 if (revs->tree_objects)
627 - mark_edges_uninteresting(revs->commits, revs, NULL);
627 + mark_edges_uninteresting(revs, NULL);
628 }
629
630 static void exit_if_skipped_commits(struct commit_list *tried,
builtin/pack-objects.c
+1 -1
@@ -2378,7 +2378,7 @@ static void get_object_list(int ac, const char **av)
2378
2379 if (prepare_revision_walk(&revs))
2380 die("revision walk setup failed");
2381 - mark_edges_uninteresting(revs.commits, &revs, show_edge);
2381 + mark_edges_uninteresting(&revs, show_edge);
2382 traverse_commit_list(&revs, show_commit, show_object, NULL);
2383
2384 if (keep_unreachable)
builtin/rev-list.c
+1 -1
@@ -336,7 +336,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
336 if (prepare_revision_walk(&revs))
337 die("revision walk setup failed");
338 if (revs.tree_objects)
339 - mark_edges_uninteresting(revs.commits, &revs, show_edge);
339 + mark_edges_uninteresting(&revs, show_edge);
340
341 if (bisect_list) {
342 int reaches = reaches, all = all;
http-push.c
+1 -1
@@ -1976,7 +1976,7 @@ int main(int argc, char **argv)
1976 pushing = 0;
1977 if (prepare_revision_walk(&revs))
1978 die("revision walk setup failed");
1979 - mark_edges_uninteresting(revs.commits, &revs, NULL);
1979 + mark_edges_uninteresting(&revs, NULL);
1980 objects_to_send = get_delta(&revs, ref_lock);
1981 finish_all_active_slots();
1982
list-objects.c
+3 -4
@@ -145,11 +145,10 @@ static void mark_edge_parents_uninteresting(struct commit *commit,
145 }
146 }
147
148 -void mark_edges_uninteresting(struct commit_list *list,
149 - struct rev_info *revs,
150 - show_edge_fn show_edge)
148 +void mark_edges_uninteresting(struct rev_info *revs, show_edge_fn show_edge)
149 {
152 - for ( ; list; list = list->next) {
150 + struct commit_list *list;
151 + for (list = revs->commits; list; list = list->next) {
152 struct commit *commit = list->item;
153
154 if (commit->object.flags & UNINTERESTING) {
list-objects.h
+1 -1
@@ -6,6 +6,6 @@ typedef void (*show_object_fn)(struct object *, const struct name_path *, const
6 void traverse_commit_list(struct rev_info *, show_commit_fn, show_object_fn, void *);
7
8 typedef void (*show_edge_fn)(struct commit *);
9 -void mark_edges_uninteresting(struct commit_list *, struct rev_info *, show_edge_fn);
9 +void mark_edges_uninteresting(struct rev_info *, show_edge_fn);
10
11 #endif