aboutsummaryrefslogtreecommitdiff
path: root/unpack-trees.c
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2007-10-30 14:57:33 -0400
committerJunio C Hamano <gitster@pobox.com>2007-10-30 16:08:40 -0700
commit4d4fcc5451d9d653bebcc8afa18543cb426abeed (patch)
tree4cf86181f94c46f0c56317132ac42dd403c71674 /unpack-trees.c
parentdc6a0757c4f966dd124bd85be2adad5a0b7b2167 (diff)
downloadgit-4d4fcc5451d9d653bebcc8afa18543cb426abeed.tar.gz
git-4d4fcc5451d9d653bebcc8afa18543cb426abeed.tar.xz
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 'unpack-trees.c')
-rw-r--r--unpack-trees.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index 6776c29cd..c527d7d04 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -316,9 +316,8 @@ static void check_updates(struct cache_entry **src, int nr,
while (nr--) {
struct cache_entry *ce = *src++;
- if (total)
- if (!ce->ce_mode || ce->ce_flags & mask)
- display_progress(progress, ++cnt);
+ if (!ce->ce_mode || ce->ce_flags & mask)
+ display_progress(progress, ++cnt);
if (!ce->ce_mode) {
if (o->update)
unlink_entry(ce->name, last_symlink);
@@ -332,8 +331,7 @@ static void check_updates(struct cache_entry **src, int nr,
}
}
}
- if (total)
- stop_progress(&progress);
+ stop_progress(&progress);
}
int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options *o)