summaryrefslogtreecommitdiff
path: root/include/git2/remote.h
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 /include/git2/remote.h
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 'include/git2/remote.h')
-rw-r--r--include/git2/remote.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/git2/remote.h b/include/git2/remote.h
index b75a9911c..1f52fcd94 100644
--- a/include/git2/remote.h
+++ b/include/git2/remote.h
@@ -499,6 +499,7 @@ typedef int GIT_CALLBACK(git_push_negotiation)(const git_push_update **updates,
*/
typedef int GIT_CALLBACK(git_push_update_reference_cb)(const char *refname, const char *status, void *data);
+#ifndef GIT_DEPRECATE_HARD
/**
* Callback to resolve URLs before connecting to remote
*
@@ -510,8 +511,10 @@ typedef int GIT_CALLBACK(git_push_update_reference_cb)(const char *refname, cons
* @param direction GIT_DIRECTION_FETCH or GIT_DIRECTION_PUSH
* @param payload Payload provided by the caller
* @return 0 on success, GIT_PASSTHROUGH or an error
+ * @deprecated Use `git_remote_set_instance_url`
*/
typedef int GIT_CALLBACK(git_url_resolve_cb)(git_buf *url_resolved, const char *url, int direction, void *payload);
+#endif
/**
* Callback invoked immediately before we attempt to connect to the
@@ -620,11 +623,18 @@ struct git_remote_callbacks {
*/
void *payload;
+#ifdef GIT_DEPRECATE_HARD
+ void *reserved;
+#else
/**
* Resolve URL before connecting to remote.
* The returned URL will be used to connect to the remote instead.
+ *
+ * This callback is deprecated; users should use
+ * git_remote_ready_cb and configure the instance URL instead.
*/
git_url_resolve_cb resolve_url;
+#endif
};
#define GIT_REMOTE_CALLBACKS_VERSION 1