diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-08-10 22:18:21 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-08-10 22:18:21 -0700 |
commit | 56b36b834db41ea81066000f02c13ea8d63cbfcb (patch) | |
tree | e8b557acb97ecb607a6d4e647938d00d19f927d4 /transport.c | |
parent | 14468ab45bae83ad300f17f41fe8fd555329ee5e (diff) | |
parent | 481c7a6db907774d0f06565d00fd06500a7ae7a4 (diff) | |
download | git-56b36b834db41ea81066000f02c13ea8d63cbfcb.tar.gz |
Merge branch 'jk/push-quiet'
* jk/push-quiet:
transport: don't show push status if --quiet is given
transport: pass "quiet" flag to pack-objects
push: add --quiet flag
Diffstat (limited to 'transport.c')
-rw-r--r-- | transport.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/transport.c b/transport.c index 8a42e76b3e..afec5b731a 100644 --- a/transport.c +++ b/transport.c @@ -667,6 +667,21 @@ static int fetch_refs_via_pack(struct transport *transport, return (refs ? 0 : -1); } +static int push_had_errors(struct ref *ref) +{ + for (; ref; ref = ref->next) { + switch (ref->status) { + case REF_STATUS_NONE: + case REF_STATUS_UPTODATE: + case REF_STATUS_OK: + break; + default: + return 1; + } + } + return 0; +} + static int refs_pushed(struct ref *ref) { for (; ref; ref = ref->next) { @@ -878,6 +893,7 @@ static int git_transport_push(struct transport *transport, struct ref *remote_re args.force_update = !!(flags & TRANSPORT_PUSH_FORCE); args.use_thin_pack = data->thin; args.verbose = !!(flags & TRANSPORT_PUSH_VERBOSE); + args.quiet = !!(flags & TRANSPORT_PUSH_QUIET); args.dry_run = !!(flags & TRANSPORT_PUSH_DRY_RUN); ret = send_pack(&args, data->fd, data->conn, remote_refs, @@ -995,6 +1011,7 @@ int transport_push(struct transport *transport, struct ref *local_refs = get_local_heads(); int match_flags = MATCH_REFS_NONE; int verbose = flags & TRANSPORT_PUSH_VERBOSE; + int quiet = flags & TRANSPORT_PUSH_QUIET; int porcelain = flags & TRANSPORT_PUSH_PORCELAIN; int ret; @@ -1010,7 +1027,9 @@ int transport_push(struct transport *transport, ret = transport->push_refs(transport, remote_refs, flags); - print_push_status(transport->url, remote_refs, verbose | porcelain, porcelain); + if (!quiet || push_had_errors(remote_refs)) + print_push_status(transport->url, remote_refs, + verbose | porcelain, porcelain); if (!(flags & TRANSPORT_PUSH_DRY_RUN)) { struct ref *ref; |