Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2007-10-30 21:57:31 +0300
committerJunio C Hamano <gitster@pobox.com>2007-10-31 02:08:40 +0300
commit0e549137966feb016927a827fb6e359aec8264a3 (patch)
tree7baf39aac449bf67e1178a7baa8bb3ac30da63d0
parent0e30404370c24047c5fa54b2a6c43e53629c916b (diff)
prune-packed: don't call display_progress() for every file
The progress count is per fanout directory, so it is useless to call it for every file as the count doesn't change that often. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin-prune-packed.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin-prune-packed.c b/builtin-prune-packed.c
index 015c8bb7cc..907e36828f 100644
--- a/builtin-prune-packed.c
+++ b/builtin-prune-packed.c
@@ -15,6 +15,9 @@ static void prune_dir(int i, DIR *dir, char *pathname, int len, int opts)
struct dirent *de;
char hex[40];
+ if (opts == VERBOSE)
+ display_progress(&progress, i + 1);
+
sprintf(hex, "%02x", i);
while ((de = readdir(dir)) != NULL) {
unsigned char sha1[20];
@@ -26,8 +29,6 @@ static void prune_dir(int i, DIR *dir, char *pathname, int len, int opts)
if (!has_sha1_pack(sha1, NULL))
continue;
memcpy(pathname + len, de->d_name, 38);
- if (opts == VERBOSE)
- display_progress(&progress, i + 1);
if (opts & DRY_RUN)
printf("rm -f %s\n", pathname);
else if (unlink(pathname) < 0)