Add some missing error messages.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
diff --git a/src/transports/ssh.c b/src/transports/ssh.c
index f2480b2..bb38438 100644
--- a/src/transports/ssh.c
+++ b/src/transports/ssh.c
@@ -353,24 +353,31 @@ static int _git_ssh_setup_conn(
t->owner->cred_acquire_payload) < 0)
goto on_error;
} else {
- goto on_error;
- }
+ giterr_set(GITERR_NET, "Cannot set up SSH connection without credentials");
+ goto on_error;
+ }
assert(t->cred);
if (!user) {
user = git__strdup(default_user);
}
- if (_git_ssh_session_create(&session, s->socket) < 0)
+ if (_git_ssh_session_create(&session, s->socket) < 0) {
+ giterr_set(GITERR_NET, "Failed to initialize SSH session");
goto on_error;
-
- if (_git_ssh_authenticate_session(session, user, t->cred) < 0)
+ }
+
+ if (_git_ssh_authenticate_session(session, user, t->cred) < 0) {
+ giterr_set(GITERR_NET, "Failed to authenticate SSH session");
goto on_error;
-
+ }
+
channel = libssh2_channel_open_session(session);
- if (!channel)
- goto on_error;
-
+ if (!channel) {
+ giterr_set(GITERR_NET, "Failed to open SSH channel");
+ goto on_error;
+ }
+
libssh2_channel_set_blocking(channel, 1);
s->session = session;