Skip to content

Conversation

@tiennou
Copy link
Contributor

@tiennou tiennou commented Jul 3, 2013

See #1700.

I was wondering about the direct return -1 while the rest uses goto on_error so I changed it.

@tiennou
Copy link
Contributor Author

tiennou commented Jul 3, 2013

Also also, I'm somewhat saddened about the "useless" error reporting (since I come here while trying to add remote fetching to Objective-Git). Would it be possible to have more meaningful error codes ?

@arrbee
Copy link
Member

arrbee commented Jul 9, 2013

I'm not super familiar with this code, so I'd been hoping that someone with more knowledge of the networking code would comment. If no one else has been able to look at this by tomorrow, I'll dive in and check it out.

@tiennou
Copy link
Contributor Author

tiennou commented Jul 9, 2013

Are you talking about the NULL callback crash or the error reporting ? I'm happy to take a look and check that in that PR if you want.

@arrbee
Copy link
Member

arrbee commented Jul 9, 2013

✨ The new goto on_error seems like the right thing to do. There are only a couple very minor problems.

  • The new goto jumps to returning -1 without setting an error message which will be confusing for the end user. It should probably read something like:
    } else {
        giterr_set(GITERR_NET, "Cannot set up SSH connection without credentials");
        goto on_error;
    }
  • It seems like the indentation on that new goto statement doesn't match the code around it. Libgit2 uses tabs for indentation (I know, crazy!) so if you could fix it to match the other indentation and use tabs, that would be great.

@tiennou
Copy link
Contributor Author

tiennou commented Jul 10, 2013

🎧

Also includes some error messages for SSH connection failures. Would a wrapper around libssh2_session_last_error be useful for those ?

@arrbee
Copy link
Member

arrbee commented Jul 10, 2013

@tiennou Let's get this merged first, but I do like the idea of wrapping libssh2_session_last_error to get better error information.

@vmg vmg merged commit 08bf80f into libgit2:development Jul 10, 2013
@arrbee
Copy link
Member

arrbee commented Jul 10, 2013

Thanks @tiennou ! If you want to go further with the libssh2_session_last_error idea, I'd be happy to see that.

@tiennou tiennou deleted the ssh-cred-fix branch July 15, 2013 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants