list-objects: reduce one argument in mark_edges_uninteresting
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Fri, 16 Aug 2013 09:52:06 +0000 (16:52 +0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 28 Aug 2013 18:54:18 +0000 (11:54 -0700)
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>
bisect.c
builtin/pack-objects.c
builtin/rev-list.c
http-push.c
list-objects.c
list-objects.h
index 71c19581daccffc87e5128c61d9adfae0be3e7de..1e46a4f50e16f059fa768cecc4c8331a88997021 100644 (file)
--- a/bisect.c
+++ b/bisect.c
@@ -624,7 +624,7 @@ static void bisect_common(struct rev_info *revs)
        if (prepare_revision_walk(revs))
                die("revision walk setup failed");
        if (revs->tree_objects)
-               mark_edges_uninteresting(revs->commits, revs, NULL);
+               mark_edges_uninteresting(revs, NULL);
 }
 
 static void exit_if_skipped_commits(struct commit_list *tried,
index f069462cb03bbae46dae8d6b97420b3726690c47..dd117b379ac9d7b58b439a691b90c6cb4f1dac90 100644 (file)
@@ -2378,7 +2378,7 @@ static void get_object_list(int ac, const char **av)
 
        if (prepare_revision_walk(&revs))
                die("revision walk setup failed");
-       mark_edges_uninteresting(revs.commits, &revs, show_edge);
+       mark_edges_uninteresting(&revs, show_edge);
        traverse_commit_list(&revs, show_commit, show_object, NULL);
 
        if (keep_unreachable)
index a5ec30d74ee1945ddaf99c89307e59aec714714a..4fc16166374b86927e605ccbfe341aebe0e3240f 100644 (file)
@@ -336,7 +336,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
        if (prepare_revision_walk(&revs))
                die("revision walk setup failed");
        if (revs.tree_objects)
-               mark_edges_uninteresting(revs.commits, &revs, show_edge);
+               mark_edges_uninteresting(&revs, show_edge);
 
        if (bisect_list) {
                int reaches = reaches, all = all;
index 6dad188b5f31d47fdce86e5104aa3c6b899ebed7..cde6416d37751fe0724e7c021e858530a74cf466 100644 (file)
@@ -1976,7 +1976,7 @@ int main(int argc, char **argv)
                pushing = 0;
                if (prepare_revision_walk(&revs))
                        die("revision walk setup failed");
-               mark_edges_uninteresting(revs.commits, &revs, NULL);
+               mark_edges_uninteresting(&revs, NULL);
                objects_to_send = get_delta(&revs, ref_lock);
                finish_all_active_slots();
 
index 3dd4a960190a1b0016b26dec9187692111b73e3f..db8ee4f04deb8093dd56f042ae0680a0b06ca20b 100644 (file)
@@ -145,11 +145,10 @@ static void mark_edge_parents_uninteresting(struct commit *commit,
        }
 }
 
-void mark_edges_uninteresting(struct commit_list *list,
-                             struct rev_info *revs,
-                             show_edge_fn show_edge)
+void mark_edges_uninteresting(struct rev_info *revs, show_edge_fn show_edge)
 {
-       for ( ; list; list = list->next) {
+       struct commit_list *list;
+       for (list = revs->commits; list; list = list->next) {
                struct commit *commit = list->item;
 
                if (commit->object.flags & UNINTERESTING) {
index 3db7bb6fa386df2ccb73b78ee72881f32074a1b8..136a1da5a6f048c0f4645112cdbf29c7b0982526 100644 (file)
@@ -6,6 +6,6 @@ typedef void (*show_object_fn)(struct object *, const struct name_path *, const
 void traverse_commit_list(struct rev_info *, show_commit_fn, show_object_fn, void *);
 
 typedef void (*show_edge_fn)(struct commit *);
-void mark_edges_uninteresting(struct commit_list *, struct rev_info *, show_edge_fn);
+void mark_edges_uninteresting(struct rev_info *, show_edge_fn);
 
 #endif