summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2021-08-27 11:25:51 -0400
committerEdward Thomson <ethomson@edwardthomson.com>2021-08-29 10:39:28 -0400
commit7442c000d95faffd9a2f44d5822101525eb8d0d9 (patch)
tree97447e6b56be4c260d4960fef8d60d9750ec82c4 /src
parent72df17c659619707e4e5f27b2a51db60848a1d04 (diff)
downloadlibgit2-ethomson/custom_url.tar.gz
remote: deprecate resolve_url callbackethomson/custom_url
Using a callback to set a resolve_url is not particularly idiomatic. Deprecate it in favor of the `set_instance_url` and `set_instance_pushurl` functions which can now be called from the `git_remote_ready_cb` callback.
Diffstat (limited to 'src')
-rw-r--r--src/remote.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/remote.c b/src/remote.c
index 8050e65f3..73375b352 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -682,8 +682,16 @@ int git_remote_set_pushurl(git_repository *repo, const char *remote, const char*
return set_url(repo, remote, CONFIG_PUSHURL_FMT, url);
}
-static int resolve_url(git_buf *resolved_url, const char *url, int direction, const git_remote_callbacks *callbacks)
-{
+static int resolve_url(
+ git_buf *resolved_url,
+ const char *url,
+ int direction,
+ const git_remote_callbacks *callbacks)
+{
+#ifdef GIT_DEPRECATE_HARD
+ GIT_UNUSED(direction);
+ GIT_UNUSED(callbacks);
+#else
int status, error;
if (callbacks && callbacks->resolve_url) {
@@ -698,11 +706,16 @@ static int resolve_url(git_buf *resolved_url, const char *url, int direction, co
return status;
}
}
+#endif
return git_buf_sets(resolved_url, url);
}
-int git_remote__urlfordirection(git_buf *url_out, struct git_remote *remote, int direction, const git_remote_callbacks *callbacks)
+int git_remote__urlfordirection(
+ git_buf *url_out,
+ struct git_remote *remote,
+ int direction,
+ const git_remote_callbacks *callbacks)
{
const char *url = NULL;