summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dc6a075)
raw | patch | inline | side by side (parent: dc6a075)
author | Nicolas Pitre <nico@cam.org> | |
Tue, 30 Oct 2007 18:57:33 +0000 (14:57 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 30 Oct 2007 23:08:40 +0000 (16:08 -0700) |
Since it is now OK to pass a null pointer to display_progress() and
stop_progress() resulting in a no-op, then we can simplify the code
and remove a bunch of lines by not making those calls conditional all
the time.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
stop_progress() resulting in a no-op, then we can simplify the code
and remove a bunch of lines by not making those calls conditional all
the time.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 3ca5cc780088a7076f46cff7f968cf45764de1ec..52a26a28f4f84180ae74dc9b3ebce9c49afc4166 100644 (file)
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
if (!offset_one)
break;
offset = offset_one;
- if (do_progress)
- display_progress(progress_state, written);
+ display_progress(progress_state, written);
}
/*
} while (nr_remaining && i < nr_objects);
free(written_list);
- if (do_progress)
- stop_progress(&progress_state);
+ stop_progress(&progress_state);
if (written != nr_result)
die("wrote %u objects while expecting %u", written, nr_result);
/*
else
object_ix[-1 - ix] = nr_objects;
- if (progress)
- display_progress(progress_state, nr_objects);
+ display_progress(progress_state, nr_objects);
if (name && no_try_delta(name))
entry->no_try_delta = 1;
progress_lock();
(*processed)++;
- if (progress)
- display_progress(progress_state, *processed);
+ display_progress(progress_state, *processed);
progress_unlock();
/*
nr_deltas);
qsort(delta_list, n, sizeof(*delta_list), type_size_sort);
ll_find_deltas(delta_list, n, window+1, depth, &nr_done);
- if (progress)
- stop_progress(&progress_state);
+ stop_progress(&progress_state);
if (nr_done != nr_deltas)
die("inconsistency with delta count");
}
rp_av[rp_ac] = NULL;
get_object_list(rp_ac, rp_av);
}
- if (progress)
- stop_progress(&progress_state);
+ stop_progress(&progress_state);
if (non_empty && !nr_result)
return 0;
diff --git a/builtin-prune-packed.c b/builtin-prune-packed.c
index c66fb037f6ef10e370b1a405e8e27dbb0e753a17..f4287dad10da4f2200f5df8ad2a0667e24b5ecc6 100644 (file)
--- a/builtin-prune-packed.c
+++ b/builtin-prune-packed.c
struct dirent *de;
char hex[40];
- if (opts == VERBOSE)
- display_progress(progress, i + 1);
+ display_progress(progress, i + 1);
sprintf(hex, "%02x", i);
while ((de = readdir(dir)) != NULL) {
prune_dir(i, d, pathname, len + 3, opts);
closedir(d);
}
- if (opts == VERBOSE)
- stop_progress(&progress);
+ stop_progress(&progress);
}
int cmd_prune_packed(int argc, const char **argv, const char *prefix)
index e0ecbc51a77b207fda0cdee50a4385fbcb550720..1e51865c52231e80cfdbbb19c8b6fa86ee8855d2 100644 (file)
--- a/builtin-unpack-objects.c
+++ b/builtin-unpack-objects.c
obj_list = xmalloc(nr_objects * sizeof(*obj_list));
for (i = 0; i < nr_objects; i++) {
unpack_one(i);
- if (!quiet)
- display_progress(progress, i + 1);
+ display_progress(progress, i + 1);
}
- if (!quiet)
- stop_progress(&progress);
+ stop_progress(&progress);
if (delta_list)
die("unresolved deltas left after unpacking");
diff --git a/index-pack.c b/index-pack.c
index b4543a4cc20ffabde3de8dc77f25af31255a94dd..879ea1548562b84a079a45c6195ab5a286195042 100644 (file)
--- a/index-pack.c
+++ b/index-pack.c
} else
sha1_object(data, obj->size, obj->type, obj->idx.sha1);
free(data);
- if (verbose)
- display_progress(progress, i+1);
+ display_progress(progress, i+1);
}
objects[i].idx.offset = consumed_bytes;
- if (verbose)
- stop_progress(&progress);
+ stop_progress(&progress);
/* Check pack integrity */
flush();
obj->size, obj->type);
}
free(data);
- if (verbose)
- display_progress(progress, nr_resolved_deltas);
+ display_progress(progress, nr_resolved_deltas);
}
}
die("local object %s is corrupt", sha1_to_hex(d->base.sha1));
append_obj_to_pack(d->base.sha1, data, size, type);
free(data);
- if (verbose)
- display_progress(progress, nr_resolved_deltas);
+ display_progress(progress, nr_resolved_deltas);
}
free(sorted_by_pos);
}
deltas = xmalloc(nr_objects * sizeof(struct delta_entry));
parse_pack_objects(sha1);
if (nr_deltas == nr_resolved_deltas) {
- if (verbose)
- stop_progress(&progress);
+ stop_progress(&progress);
/* Flush remaining pack final 20-byte SHA1. */
flush();
} else {
(nr_objects + nr_unresolved + 1)
* sizeof(*objects));
fix_unresolved_deltas(nr_unresolved);
- if (verbose) {
- stop_progress(&progress);
+ stop_progress(&progress);
+ if (verbose)
fprintf(stderr, "%d objects were added to complete this thin pack.\n",
nr_objects - nr_objects_initial);
- }
fixup_pack_header_footer(output_fd, sha1,
curr_pack, nr_objects);
}
diff --git a/unpack-trees.c b/unpack-trees.c
index 6776c29cde3e4f5125d38827e9aa2148dd987dc8..c527d7d049155d1808e0bf69aba42d49cea7b68f 100644 (file)
--- a/unpack-trees.c
+++ b/unpack-trees.c
while (nr--) {
struct cache_entry *ce = *src++;
- if (total)
- if (!ce->ce_mode || ce->ce_flags & mask)
- display_progress(progress, ++cnt);
+ if (!ce->ce_mode || ce->ce_flags & mask)
+ display_progress(progress, ++cnt);
if (!ce->ce_mode) {
if (o->update)
unlink_entry(ce->name, last_symlink);
}
}
}
- if (total)
- stop_progress(&progress);
+ stop_progress(&progress);
}
int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options *o)