summaryrefslogtreecommitdiff
path: root/include/git2/transport.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-07-04 10:00:39 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2014-07-07 14:51:51 +0200
commitd4256ed554fa64f762d53cb2a64663e5095d3eb5 (patch)
tree45a5b926a5a04f346a0feb10242012a2677e8d62 /include/git2/transport.h
parent9b87998c97fedcf0c22cef28bb0839ecd68c1efd (diff)
downloadlibgit2-d4256ed554fa64f762d53cb2a64663e5095d3eb5.tar.gz
ssh: provide a factory function for setting ssh pathscmn/ssh-factory-for-paths
git allows you to set which paths to use for the git server programs when connecting over ssh; and we want to provide something similar. We do this by providing a factory function which can be set as the remote's transport callback which will set the given paths upon creation.
Diffstat (limited to 'include/git2/transport.h')
-rw-r--r--include/git2/transport.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/git2/transport.h b/include/git2/transport.h
index 1df264ea1..67939a747 100644
--- a/include/git2/transport.h
+++ b/include/git2/transport.h
@@ -336,6 +336,22 @@ GIT_EXTERN(int) git_transport_init(
*/
GIT_EXTERN(int) git_transport_new(git_transport **out, git_remote *owner, const char *url);
+/**
+ * Create an ssh transport with custom git command paths
+ *
+ * This is a factory function suitable for setting as the transport
+ * callback in a remote (or for a clone in the options).
+ *
+ * The payload argument must be a strarray pointer with the paths for
+ * the `git-upload-pack` and `git-receive-pack` at index 0 and 1.
+ *
+ * @param out the resulting transport
+ * @param owner the owning remote
+ * @param payload a strarray with the paths
+ * @return 0 or an error code
+ */
+GIT_EXTERN(int) git_transport_ssh_with_paths(git_transport **out, git_remote *owner, void *payload);
+
/* Signature of a function which creates a transport */
typedef int (*git_transport_cb)(git_transport **out, git_remote *owner, void *param);