Commit 82154e58 by Edward Thomson

remote functions: return an int

Stop returning a void for functions, future-proofing them to allow them
to fail.
parent 3351506a
...@@ -378,8 +378,9 @@ GIT_EXTERN(int) git_remote_connected(const git_remote *remote); ...@@ -378,8 +378,9 @@ GIT_EXTERN(int) git_remote_connected(const git_remote *remote);
* the operation has been cancelled and if so stops the operation. * the operation has been cancelled and if so stops the operation.
* *
* @param remote the remote * @param remote the remote
* @return 0 on success, or an error code
*/ */
GIT_EXTERN(void) git_remote_stop(git_remote *remote); GIT_EXTERN(int) git_remote_stop(git_remote *remote);
/** /**
* Disconnect from the remote * Disconnect from the remote
...@@ -387,8 +388,9 @@ GIT_EXTERN(void) git_remote_stop(git_remote *remote); ...@@ -387,8 +388,9 @@ GIT_EXTERN(void) git_remote_stop(git_remote *remote);
* Close the connection to the remote. * Close the connection to the remote.
* *
* @param remote the remote to disconnect from * @param remote the remote to disconnect from
* @return 0 on success, or an error code
*/ */
GIT_EXTERN(void) git_remote_disconnect(git_remote *remote); GIT_EXTERN(int) git_remote_disconnect(git_remote *remote);
/** /**
* Free the memory associated with a remote * Free the memory associated with a remote
......
...@@ -1676,20 +1676,24 @@ int git_remote_connected(const git_remote *remote) ...@@ -1676,20 +1676,24 @@ int git_remote_connected(const git_remote *remote)
return remote->transport->is_connected(remote->transport); return remote->transport->is_connected(remote->transport);
} }
void git_remote_stop(git_remote *remote) int git_remote_stop(git_remote *remote)
{ {
assert(remote); assert(remote);
if (remote->transport && remote->transport->cancel) if (remote->transport && remote->transport->cancel)
remote->transport->cancel(remote->transport); remote->transport->cancel(remote->transport);
return 0;
} }
void git_remote_disconnect(git_remote *remote) int git_remote_disconnect(git_remote *remote)
{ {
assert(remote); assert(remote);
if (git_remote_connected(remote)) if (git_remote_connected(remote))
remote->transport->close(remote->transport); remote->transport->close(remote->transport);
return 0;
} }
void git_remote_free(git_remote *remote) void git_remote_free(git_remote *remote)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment