@matheusbsbs / matheus-bagliano / commits / d7c411b71d
Fork 0

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 <cbrammer@gmail.com> Helped-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Oct 17, 2010 at 02:37 UTC d7c411b71d727600d2f031fec9723873ae93c1c7
4 files changed +7 -2
builtin/send-pack.c
+3
@@ -48,6 +48,7 @@ static int pack_objects(int fd, struct ref *refs, struct extra_have_objects *ext
48 NULL,
49 NULL,
50 NULL,
51 + NULL,
52 };
53 struct child_process po;
54 int i;
@@ -59,6 +60,8 @@ static int pack_objects(int fd, struct ref *refs, struct extra_have_objects *ext
60 argv[i++] = "--delta-base-offset";
61 if (args->quiet)
62 argv[i++] = "-q";
63 + if (args->progress)
64 + argv[i++] = "--progress";
65 memset(&po, 0, sizeof(po));
66 po.argv = argv;
67 po.in = -1;
send-pack.h
+1
@@ -5,6 +5,7 @@ struct send_pack_args {
5 unsigned verbose:1,
6 quiet:1,
7 porcelain:1,
8 + progress:1,
9 send_mirror:1,
10 force_update:1,
11 use_thin_pack:1,
t/t5523-push-upstream.sh
+2 -2
@@ -78,7 +78,7 @@ test_expect_success TTY 'progress messages go to tty' '
78 grep "Writing objects" err
79 '
80
81 -test_expect_failure 'progress messages do not go to non-tty' '
81 +test_expect_success 'progress messages do not go to non-tty' '
82 ensure_fresh_upstream &&
83
84 # skip progress messages, since stderr is non-tty
@@ -86,7 +86,7 @@ test_expect_failure 'progress messages do not go to non-tty' '
86 ! grep "Writing objects" err
87 '
88
89 -test_expect_failure 'progress messages go to non-tty (forced)' '
89 +test_expect_success 'progress messages go to non-tty (forced)' '
90 ensure_fresh_upstream &&
91
92 # force progress messages to stderr, even though it is non-tty
transport.c
+1
@@ -789,6 +789,7 @@ static int git_transport_push(struct transport *transport, struct ref *remote_re
789 args.use_thin_pack = data->options.thin;
790 args.verbose = (transport->verbose > 0);
791 args.quiet = (transport->verbose < 0);
792 + args.progress = transport->progress;
793 args.dry_run = !!(flags & TRANSPORT_PUSH_DRY_RUN);
794 args.porcelain = !!(flags & TRANSPORT_PUSH_PORCELAIN);
795