summaryrefslogtreecommitdiff
path: root/src/push.c
diff options
context:
space:
mode:
authorSebastian Bauer <mail@sebastianbauer.info>2013-01-15 21:39:37 +0100
committerSebastian Bauer <mail@sebastianbauer.info>2013-01-17 20:55:06 +0100
commit9bf56c7b1cee1b0ed88bd327609250f4f34314c7 (patch)
tree7d14e23d65fdc20c793e334c27c7f1beb7204091 /src/push.c
parent34a4ad46e8ff306dca989bb591dc415e38480064 (diff)
downloadlibgit2-9bf56c7b1cee1b0ed88bd327609250f4f34314c7.tar.gz
Don't segfault if transport doesn't support push.
Instead, set an more informative error message.
Diffstat (limited to 'src/push.c')
-rw-r--r--src/push.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/push.c b/src/push.c
index 71223645a..452ead405 100644
--- a/src/push.c
+++ b/src/push.c
@@ -369,6 +369,12 @@ static int do_push(git_push *push)
int error;
git_transport *transport = push->remote->transport;
+ if (!transport->push) {
+ giterr_set(GITERR_NET, "Remote transport doesn't support push");
+ error = -1;
+ goto on_error;
+ }
+
/*
* A pack-file MUST be sent if either create or update command
* is used, even if the server already has all the necessary