Commit 7a00adcc by Edward Thomson

remote: introduce git_remote_capabilities

Provide a mechanism for (internal) users to determine a remote's
capabilities from the transport.
parent 923c1652
......@@ -1012,6 +1012,20 @@ int git_remote_ls(const git_remote_head ***out, size_t *size, git_remote *remote
return remote->transport->ls(out, size, remote->transport);
}
int git_remote_capabilities(unsigned int *out, git_remote *remote)
{
GIT_ASSERT_ARG(remote);
*out = 0;
if (!remote->transport) {
git_error_set(GIT_ERROR_NET, "this remote has never connected");
return -1;
}
return remote->transport->capabilities(out, remote->transport);
}
static int lookup_config(char **out, git_config *cfg, const char *name)
{
git_config_entry *ce = NULL;
......
......@@ -54,4 +54,6 @@ int git_remote_connect_options_normalize(
const git_remote_connect_options *src);
void git_remote_connect_options_dispose(git_remote_connect_options *opts);
int git_remote_capabilities(unsigned int *out, git_remote *remote);
#endif
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