summaryrefslogtreecommitdiff
path: root/builtin-pack-objects.c
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2007-10-30 18:57:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-10-30 23:08:40 (GMT)
commit4d4fcc5451d9d653bebcc8afa18543cb426abeed (patch)
tree4cf86181f94c46f0c56317132ac42dd403c71674 /builtin-pack-objects.c
parentdc6a0757c4f966dd124bd85be2adad5a0b7b2167 (diff)
downloadgit-4d4fcc5451d9d653bebcc8afa18543cb426abeed.zip
git-4d4fcc5451d9d653bebcc8afa18543cb426abeed.tar.gz
git-4d4fcc5451d9d653bebcc8afa18543cb426abeed.tar.bz2
relax usage of the progress API
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>
Diffstat (limited to 'builtin-pack-objects.c')
-rw-r--r--builtin-pack-objects.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
index 3ca5cc7..52a26a2 100644
--- a/builtin-pack-objects.c
+++ b/builtin-pack-objects.c
@@ -629,8 +629,7 @@ static void write_pack_file(void)
if (!offset_one)
break;
offset = offset_one;
- if (do_progress)
- display_progress(progress_state, written);
+ display_progress(progress_state, written);
}
/*
@@ -684,8 +683,7 @@ static void write_pack_file(void)
} 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);
/*
@@ -853,8 +851,7 @@ static int add_object_entry(const unsigned char *sha1, enum object_type type,
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;
@@ -1517,8 +1514,7 @@ static void find_deltas(struct object_entry **list, unsigned list_size,
progress_lock();
(*processed)++;
- if (progress)
- display_progress(progress_state, *processed);
+ display_progress(progress_state, *processed);
progress_unlock();
/*
@@ -1722,8 +1718,7 @@ static void prepare_pack(int window, int depth)
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");
}
@@ -2142,8 +2137,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
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;