Apply suggestions from code review Co-authored-by: Edward Thomson <ethomson@github.com>
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 46 47 48 49 50 51 52
diff --git a/include/git2/sys/remote.h b/include/git2/sys/remote.h
index bde1b16..0eae923 100644
--- a/include/git2/sys/remote.h
+++ b/include/git2/sys/remote.h
@@ -30,6 +30,8 @@ typedef enum {
/**
* Disposes libgit2-initialized fields from a git_remote_connect_options.
+ * This should only be used for git_remote_connect_options returned by
+ * git_transport_remote_connect_options.
*
* Note that this does not free the `git_remote_connect_options` itself, just
* the memory pointed to by it.
diff --git a/include/git2/sys/transport.h b/include/git2/sys/transport.h
index 8191f15..af315e3 100644
--- a/include/git2/sys/transport.h
+++ b/include/git2/sys/transport.h
@@ -280,7 +280,7 @@ GIT_EXTERN(int) git_transport_smart_proxy_options(git_proxy_options *out, git_tr
* @param out options struct to fill
* @param transport the transport to extract the data from.
*/
-GIT_EXTERN(int) git_transport_smart_remote_connect_options(
+GIT_EXTERN(int) git_transport_remote_connect_options(
git_remote_connect_options *out,
git_transport *transport);
diff --git a/src/libgit2/transports/smart.c b/src/libgit2/transports/smart.c
index 264f213..7f57dba 100644
--- a/src/libgit2/transports/smart.c
+++ b/src/libgit2/transports/smart.c
@@ -425,7 +425,7 @@ int git_transport_smart_credentials(git_credential **out, git_transport *transpo
return connect_opts->callbacks.credentials(out, t->url, user, methods, connect_opts->callbacks.payload);
}
-int git_transport_smart_remote_connect_options(
+int git_transport_remote_connect_options(
git_remote_connect_options *out,
git_transport *transport)
{
diff --git a/tests/libgit2/transport/register.c b/tests/libgit2/transport/register.c
index 216f11e..4d3c097 100644
--- a/tests/libgit2/transport/register.c
+++ b/tests/libgit2/transport/register.c
@@ -134,7 +134,7 @@ static int custom_subtransport__action(
GIT_UNUSED(url);
GIT_UNUSED(action);
- ret = git_transport_smart_remote_connect_options(&opts, t->owner);
+ ret = git_transport_remote_connect_options(&opts, t->owner);
/* increase the counter once if this function was called at all and once more if the URL matches. */
(*t->called)++;