Skip to content

Commit 9e3e789

Browse files
committed
Merge branch 'jc/maint-bundle-too-quiet'
* jc/maint-bundle-too-quiet: Teach progress eye-candy to fetch_refs_from_bundle()
2 parents 9c14001 + be042af commit 9e3e789

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

builtin/bundle.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ int cmd_bundle(int argc, const char **argv, const char *prefix)
5858
} else if (!strcmp(cmd, "unbundle")) {
5959
if (!startup_info->have_repository)
6060
die(_("Need a repository to unbundle."));
61-
return !!unbundle(&header, bundle_fd) ||
61+
return !!unbundle(&header, bundle_fd, 0) ||
6262
list_bundle_refs(&header, argc, argv);
6363
} else
6464
usage(builtin_bundle_usage);

bundle.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,12 +380,15 @@ int create_bundle(struct bundle_header *header, const char *path,
380380
return 0;
381381
}
382382

383-
int unbundle(struct bundle_header *header, int bundle_fd)
383+
int unbundle(struct bundle_header *header, int bundle_fd, int flags)
384384
{
385385
const char *argv_index_pack[] = {"index-pack",
386-
"--fix-thin", "--stdin", NULL};
386+
"--fix-thin", "--stdin", NULL, NULL};
387387
struct child_process ip;
388388

389+
if (flags & BUNDLE_VERBOSE)
390+
argv_index_pack[3] = "-v";
391+
389392
if (verify_bundle(header, 0))
390393
return -1;
391394
memset(&ip, 0, sizeof(ip));

bundle.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ int read_bundle_header(const char *path, struct bundle_header *header);
1818
int create_bundle(struct bundle_header *header, const char *path,
1919
int argc, const char **argv);
2020
int verify_bundle(struct bundle_header *header, int verbose);
21-
int unbundle(struct bundle_header *header, int bundle_fd);
21+
#define BUNDLE_VERBOSE 1
22+
int unbundle(struct bundle_header *header, int bundle_fd, int flags);
2223
int list_bundle_refs(struct bundle_header *header,
2324
int argc, const char **argv);
2425

transport.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,8 @@ static int fetch_refs_from_bundle(struct transport *transport,
432432
int nr_heads, struct ref **to_fetch)
433433
{
434434
struct bundle_transport_data *data = transport->data;
435-
return unbundle(&data->header, data->fd);
435+
return unbundle(&data->header, data->fd,
436+
transport->progress ? BUNDLE_VERBOSE : 0);
436437
}
437438

438439
static int close_bundle(struct transport *transport)

0 commit comments

Comments
 (0)