From be042aff24c8a17565934874f5d2eebd77ab2562 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 18 Sep 2011 16:52:32 -0700 Subject: Teach progress eye-candy to fetch_refs_from_bundle() With the usual "git" transport, a large-ish transfer with "git fetch" and "git pull" give progress eye-candy to avoid boring users. However, not when they are reading from a bundle. I.e. $ git pull ../git-bundle.bndl master This teaches bundle.c:unbundle() to give "-v" option to index-pack and tell it to give progress bar when transport decides it is necessary. The operation in the other direction, "git bundle create", could also learn to honor --quiet but that is a separate issue. Signed-off-by: Junio C Hamano --- bundle.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'bundle.c') diff --git a/bundle.c b/bundle.c index f48fd7d4c1..6bf849740c 100644 --- a/bundle.c +++ b/bundle.c @@ -380,12 +380,15 @@ int create_bundle(struct bundle_header *header, const char *path, return 0; } -int unbundle(struct bundle_header *header, int bundle_fd) +int unbundle(struct bundle_header *header, int bundle_fd, int flags) { const char *argv_index_pack[] = {"index-pack", - "--fix-thin", "--stdin", NULL}; + "--fix-thin", "--stdin", NULL, NULL}; struct child_process ip; + if (flags & BUNDLE_VERBOSE) + argv_index_pack[3] = "-v"; + if (verify_bundle(header, 0)) return -1; memset(&ip, 0, sizeof(ip)); -- cgit v1.2.3