summaryrefslogtreecommitdiff
path: root/builtin-prune-packed.c
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2007-10-30 18:57:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-10-30 23:08:40 (GMT)
commitdc6a0757c4f966dd124bd85be2adad5a0b7b2167 (patch)
treee6b910be55af5d634bb7cc187985ddf57c70a01b /builtin-prune-packed.c
parent0e549137966feb016927a827fb6e359aec8264a3 (diff)
downloadgit-dc6a0757c4f966dd124bd85be2adad5a0b7b2167.zip
git-dc6a0757c4f966dd124bd85be2adad5a0b7b2167.tar.gz
git-dc6a0757c4f966dd124bd85be2adad5a0b7b2167.tar.bz2
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 907e368..c66fb03 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)