summaryrefslogtreecommitdiff
path: root/transport.c
diff options
context:
space:
mode:
authorTay Ray Chuan <rctay89@gmail.com>2010-02-24 20:50:23 +0800
committerJunio C Hamano <gitster@pobox.com>2010-02-24 08:35:44 -0800
commitbde873c52914b40377a12764cab926ee974c3f32 (patch)
tree5eac44d9bbb54661c716a748bbd89af6fb9fe584 /transport.c
parent84f88512aa5067687d226a239810f6da952673b5 (diff)
downloadgit-bde873c52914b40377a12764cab926ee974c3f32.tar.gz
fetch: refactor verbosity option handling into transport.[ch]
transport_set_verbosity() is now provided to transport users. Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'transport.c')
-rw-r--r--transport.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/transport.c b/transport.c
index 3846aacb47..1632c4d0aa 100644
--- a/transport.c
+++ b/transport.c
@@ -1013,6 +1013,14 @@ int transport_set_option(struct transport *transport,
return 1;
}
+void transport_set_verbosity(struct transport *transport, int verbosity)
+{
+ if (verbosity >= 2)
+ transport->verbose = verbosity <= 3 ? verbosity : 3;
+ if (verbosity < 0)
+ transport->verbose = -1;
+}
+
int transport_push(struct transport *transport,
int refspec_nr, const char **refspec, int flags,
int *nonfastforward)