summaryrefslogtreecommitdiff
path: root/builtin-prune-packed.c
diff options
context:
space:
mode:
authorLibravatar Nicolas Pitre <nico@cam.org>2007-10-30 14:57:32 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2007-10-30 16:08:40 -0700
commitdc6a0757c4f966dd124bd85be2adad5a0b7b2167 (patch)
treee6b910be55af5d634bb7cc187985ddf57c70a01b /builtin-prune-packed.c
parentprune-packed: don't call display_progress() for every file (diff)
downloadtgif-dc6a0757c4f966dd124bd85be2adad5a0b7b2167.tar.xz
make struct progress an opaque type
This allows for better management of progress "object" existence, as well as making the progress display implementation more independent from its callers. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-prune-packed.c')
-rw-r--r--builtin-prune-packed.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/builtin-prune-packed.c b/builtin-prune-packed.c
index 907e36828f..c66fb037f6 100644
--- a/builtin-prune-packed.c
+++ b/builtin-prune-packed.c
@@ -8,7 +8,7 @@ static const char prune_packed_usage[] =
#define DRY_RUN 01
#define VERBOSE 02
-static struct progress progress;
+static struct progress *progress;
static void prune_dir(int i, DIR *dir, char *pathname, int len, int opts)
{
@@ -16,7 +16,7 @@ static void prune_dir(int i, DIR *dir, char *pathname, int len, int opts)
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) {
@@ -46,8 +46,7 @@ void prune_packed_objects(int opts)
int len = strlen(dir);
if (opts == VERBOSE)
- start_progress_delay(&progress,
- "Removing duplicate objects",
+ progress = start_progress_delay("Removing duplicate objects",
256, 95, 2);
if (len > PATH_MAX - 42)