Skip to content

Commit

Permalink
Don't segfault if transport doesn't support push.
Browse files Browse the repository at this point in the history
Instead, set an more informative error message.
  • Loading branch information
sba1 committed Jan 17, 2013
1 parent 34a4ad4 commit 9bf56c7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/push.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9bf56c7

Please sign in to comment.