@matheusbsbs / matheus-bagliano / commits / 1e39d7deea
Fork 0

upload-pack: remove unused "create_full_pack" code in do_rev_list

A bit of history in chronological order, the newest at bottom: - 80ccaa7 (upload-pack: Move the revision walker into a separate function.) do_rev_list was introduced with create_full_pack argument - 21edd3f (upload-pack: Run rev-list in an asynchronous function.) do_rev_list was now called by start_async, create_full_pack was passed by rev_list.data - f0cea83 (Shift object enumeration out of upload-pack) rev_list.data was now zero permanently. Creating full pack was done by passing --all to pack-objects - ae6a560 (run-command: support custom fd-set in async) rev_list.data = 0 was found out redudant and got rid of. Get rid of the code as well, for less headache while reading do_rev_list. [jc: noticed by Elijah Newren] 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 Jul 28, 2010 at 16:39 UTC 1e39d7deea6719074b5b1487d1634d4704da357b
1 file changed +12 -17
upload-pack.c
+12 -17
@@ -105,7 +105,7 @@ static void show_edge(struct commit *commit)
105 fprintf(pack_pipe, "-%s\n", sha1_to_hex(commit->object.sha1));
106 }
107
108 -static int do_rev_list(int in, int out, void *create_full_pack)
108 +static int do_rev_list(int in, int out, void *user_data)
109 {
110 int i;
111 struct rev_info revs;
@@ -118,23 +118,18 @@ static int do_rev_list(int in, int out, void *create_full_pack)
118 if (use_thin_pack)
119 revs.edge_hint = 1;
120
121 - if (create_full_pack) {
122 - const char *args[] = {"rev-list", "--all", NULL};
123 - setup_revisions(2, args, &revs, NULL);
124 - } else {
125 - for (i = 0; i < want_obj.nr; i++) {
126 - struct object *o = want_obj.objects[i].item;
127 - /* why??? */
128 - o->flags &= ~UNINTERESTING;
129 - add_pending_object(&revs, o, NULL);
130 - }
131 - for (i = 0; i < have_obj.nr; i++) {
132 - struct object *o = have_obj.objects[i].item;
133 - o->flags |= UNINTERESTING;
134 - add_pending_object(&revs, o, NULL);
135 - }
136 - setup_revisions(0, NULL, &revs, NULL);
121 + for (i = 0; i < want_obj.nr; i++) {
122 + struct object *o = want_obj.objects[i].item;
123 + /* why??? */
124 + o->flags &= ~UNINTERESTING;
125 + add_pending_object(&revs, o, NULL);
126 + }
127 + for (i = 0; i < have_obj.nr; i++) {
128 + struct object *o = have_obj.objects[i].item;
129 + o->flags |= UNINTERESTING;
130 + add_pending_object(&revs, o, NULL);
131 }
132 + setup_revisions(0, NULL, &revs, NULL);
133 if (prepare_revision_walk(&revs))
134 die("revision walk setup failed");
135 mark_edges_uninteresting(revs.commits, &revs, show_edge);