Skip to content

Commit e76a5fb

Browse files
pcloudsgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cdab485 commit e76a5fb

File tree

6 files changed

+8
-9
lines changed

6 files changed

+8
-9
lines changed

bisect.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ static void bisect_common(struct rev_info *revs)
624624
if (prepare_revision_walk(revs))
625625
die("revision walk setup failed");
626626
if (revs->tree_objects)
627-
mark_edges_uninteresting(revs->commits, revs, NULL);
627+
mark_edges_uninteresting(revs, NULL);
628628
}
629629

630630
static void exit_if_skipped_commits(struct commit_list *tried,

builtin/pack-objects.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2378,7 +2378,7 @@ static void get_object_list(int ac, const char **av)
23782378

23792379
if (prepare_revision_walk(&revs))
23802380
die("revision walk setup failed");
2381-
mark_edges_uninteresting(revs.commits, &revs, show_edge);
2381+
mark_edges_uninteresting(&revs, show_edge);
23822382
traverse_commit_list(&revs, show_commit, show_object, NULL);
23832383

23842384
if (keep_unreachable)

builtin/rev-list.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
336336
if (prepare_revision_walk(&revs))
337337
die("revision walk setup failed");
338338
if (revs.tree_objects)
339-
mark_edges_uninteresting(revs.commits, &revs, show_edge);
339+
mark_edges_uninteresting(&revs, show_edge);
340340

341341
if (bisect_list) {
342342
int reaches = reaches, all = all;

http-push.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1976,7 +1976,7 @@ int main(int argc, char **argv)
19761976
pushing = 0;
19771977
if (prepare_revision_walk(&revs))
19781978
die("revision walk setup failed");
1979-
mark_edges_uninteresting(revs.commits, &revs, NULL);
1979+
mark_edges_uninteresting(&revs, NULL);
19801980
objects_to_send = get_delta(&revs, ref_lock);
19811981
finish_all_active_slots();
19821982

list-objects.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,10 @@ static void mark_edge_parents_uninteresting(struct commit *commit,
145145
}
146146
}
147147

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)
151149
{
152-
for ( ; list; list = list->next) {
150+
struct commit_list *list;
151+
for (list = revs->commits; list; list = list->next) {
153152
struct commit *commit = list->item;
154153

155154
if (commit->object.flags & UNINTERESTING) {

list-objects.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ typedef void (*show_object_fn)(struct object *, const struct name_path *, const
66
void traverse_commit_list(struct rev_info *, show_commit_fn, show_object_fn, void *);
77

88
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);
1010

1111
#endif

0 commit comments

Comments
 (0)