summaryrefslogtreecommitdiff
path: root/unpack-objects.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-07-10 23:14:22 (GMT)
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-10 23:14:22 (GMT)
commitcf219196a89becccb50ad4a0a667a2814ddae60f (patch)
treeefd479842d3e2432c998d820284af345eccfe00b /unpack-objects.c
parent4bc5fbf82e225aef0694c91458c31515409455e6 (diff)
downloadgit-cf219196a89becccb50ad4a0a667a2814ddae60f.zip
git-cf219196a89becccb50ad4a0a667a2814ddae60f.tar.gz
git-cf219196a89becccb50ad4a0a667a2814ddae60f.tar.bz2
Fix up progress report for off-by-one error
We used to print the index of the object we unpacked, not how many we had unpacked. Which caused slightly confusing progress reports like 100% (2/3) done rather than the more obvious "3/3" for 100% ;)
Diffstat (limited to 'unpack-objects.c')
-rw-r--r--unpack-objects.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/unpack-objects.c b/unpack-objects.c
index 355889f..19874d0 100644
--- a/unpack-objects.c
+++ b/unpack-objects.c
@@ -211,7 +211,7 @@ static void unpack_one(unsigned nr, unsigned total)
static unsigned long last_sec;
static unsigned last_percent;
struct timeval now;
- unsigned percentage = ((1+nr) * 100) / total;
+ unsigned percentage = (nr * 100) / total;
gettimeofday(&now, NULL);
if (percentage != last_percent || now.tv_sec != last_sec) {
@@ -255,7 +255,7 @@ static void unpack_all(void)
use(sizeof(struct pack_header));
for (i = 0; i < nr_objects; i++)
- unpack_one(i, nr_objects);
+ unpack_one(i+1, nr_objects);
if (delta_list)
die("unresolved deltas left after unpacking");
}