summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2011-10-05 12:35:55 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-10-05 12:35:55 -0700
commit9e3e789e70701beb25b3135d292edfbc99035701 (patch)
treef23f4b4b4d23f348762c774ef038b55a5b01cd51
parentMerge branch 'jk/filter-branch-require-clean-work-tree' (diff)
parentTeach progress eye-candy to fetch_refs_from_bundle() (diff)
downloadtgif-9e3e789e70701beb25b3135d292edfbc99035701.tar.xz
Merge branch 'jc/maint-bundle-too-quiet'
* jc/maint-bundle-too-quiet: Teach progress eye-candy to fetch_refs_from_bundle()
-rw-r--r--builtin/bundle.c2
-rw-r--r--bundle.c7
-rw-r--r--bundle.h3
-rw-r--r--transport.c3
4 files changed, 10 insertions, 5 deletions
diff --git a/builtin/bundle.c b/builtin/bundle.c
index 81046a9cb8..92a8a6026a 100644
--- a/builtin/bundle.c
+++ b/builtin/bundle.c
@@ -58,7 +58,7 @@ int cmd_bundle(int argc, const char **argv, const char *prefix)
} else if (!strcmp(cmd, "unbundle")) {
if (!startup_info->have_repository)
die(_("Need a repository to unbundle."));
- return !!unbundle(&header, bundle_fd) ||
+ return !!unbundle(&header, bundle_fd, 0) ||
list_bundle_refs(&header, argc, argv);
} else
usage(builtin_bundle_usage);
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));
diff --git a/bundle.h b/bundle.h
index e2aedd60d6..c5a22c8d10 100644
--- a/bundle.h
+++ b/bundle.h
@@ -18,7 +18,8 @@ int read_bundle_header(const char *path, struct bundle_header *header);
int create_bundle(struct bundle_header *header, const char *path,
int argc, const char **argv);
int verify_bundle(struct bundle_header *header, int verbose);
-int unbundle(struct bundle_header *header, int bundle_fd);
+#define BUNDLE_VERBOSE 1
+int unbundle(struct bundle_header *header, int bundle_fd, int flags);
int list_bundle_refs(struct bundle_header *header,
int argc, const char **argv);
diff --git a/transport.c b/transport.c
index fa279d531f..e1940615e2 100644
--- a/transport.c
+++ b/transport.c
@@ -432,7 +432,8 @@ static int fetch_refs_from_bundle(struct transport *transport,
int nr_heads, struct ref **to_fetch)
{
struct bundle_transport_data *data = transport->data;
- return unbundle(&data->header, data->fd);
+ return unbundle(&data->header, data->fd,
+ transport->progress ? BUNDLE_VERBOSE : 0);
}
static int close_bundle(struct transport *transport)