Skip to content

Commit d7c411b

Browse files
peffgitster
authored andcommitted
push: pass --progress down to git-pack-objects
When pushing via builtin transports (like file://, git://), the underlying transport helper (in this case, git-pack-objects) did not get the --progress option, even if it was passed to git push. Fix this, and update the tests to reflect this. Note that according to the git-pack-objects documentation, we can safely apply the usual --progress semantics for the transport commands like clone and fetch (and for pushing over other smart transports). Reported-by: Chase Brammer <[email protected]> Helped-by: Jonathan Nieder <[email protected]> Signed-off-by: Jeff King <[email protected]> Signed-off-by: Tay Ray Chuan <[email protected]> Reviewed-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 8ac3ed2 commit d7c411b

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

builtin/send-pack.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ static int pack_objects(int fd, struct ref *refs, struct extra_have_objects *ext
4848
NULL,
4949
NULL,
5050
NULL,
51+
NULL,
5152
};
5253
struct child_process po;
5354
int i;
@@ -59,6 +60,8 @@ static int pack_objects(int fd, struct ref *refs, struct extra_have_objects *ext
5960
argv[i++] = "--delta-base-offset";
6061
if (args->quiet)
6162
argv[i++] = "-q";
63+
if (args->progress)
64+
argv[i++] = "--progress";
6265
memset(&po, 0, sizeof(po));
6366
po.argv = argv;
6467
po.in = -1;

send-pack.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ struct send_pack_args {
55
unsigned verbose:1,
66
quiet:1,
77
porcelain:1,
8+
progress:1,
89
send_mirror:1,
910
force_update:1,
1011
use_thin_pack:1,

t/t5523-push-upstream.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,15 @@ test_expect_success TTY 'progress messages go to tty' '
7878
grep "Writing objects" err
7979
'
8080

81-
test_expect_failure 'progress messages do not go to non-tty' '
81+
test_expect_success 'progress messages do not go to non-tty' '
8282
ensure_fresh_upstream &&
8383
8484
# skip progress messages, since stderr is non-tty
8585
git push -u upstream master >out 2>err &&
8686
! grep "Writing objects" err
8787
'
8888

89-
test_expect_failure 'progress messages go to non-tty (forced)' '
89+
test_expect_success 'progress messages go to non-tty (forced)' '
9090
ensure_fresh_upstream &&
9191
9292
# force progress messages to stderr, even though it is non-tty

transport.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,7 @@ static int git_transport_push(struct transport *transport, struct ref *remote_re
789789
args.use_thin_pack = data->options.thin;
790790
args.verbose = (transport->verbose > 0);
791791
args.quiet = (transport->verbose < 0);
792+
args.progress = transport->progress;
792793
args.dry_run = !!(flags & TRANSPORT_PUSH_DRY_RUN);
793794
args.porcelain = !!(flags & TRANSPORT_PUSH_PORCELAIN);
794795

0 commit comments

Comments
 (0)