summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-08-27 15:10:51 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2014-08-27 15:10:51 +0200
commit15c7da3442843b8fd2cdb95af8716ec6b5c12a40 (patch)
treeb7a0dfb73f7311283e1469182c6aaeff48e00fb9 /include/git2
parentcb92467bc284b87c38cdf32f8803a528846d094b (diff)
parent7449c82ee713024f59badf6fef9cc0ac49ce9561 (diff)
downloadlibgit2-15c7da3442843b8fd2cdb95af8716ec6b5c12a40.tar.gz
Merge branch 'cmn/ssh-retry'
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/errors.h1
-rw-r--r--include/git2/transport.h22
2 files changed, 23 insertions, 0 deletions
diff --git a/include/git2/errors.h b/include/git2/errors.h
index c914653fc..b91560631 100644
--- a/include/git2/errors.h
+++ b/include/git2/errors.h
@@ -41,6 +41,7 @@ typedef enum {
GIT_EMERGECONFLICT = -13, /**< Merge conflicts prevented operation */
GIT_ELOCKED = -14, /**< Lock file prevented operation */
GIT_EMODIFIED = -15, /**< Reference value does not match expected */
+ GIT_EAUTH = -16, /**< Authentication error */
GIT_PASSTHROUGH = -30, /**< Internal only */
GIT_ITEROVER = -31, /**< Signals end of iteration with iterator */
diff --git a/include/git2/transport.h b/include/git2/transport.h
index 66341d296..7090698ac 100644
--- a/include/git2/transport.h
+++ b/include/git2/transport.h
@@ -36,6 +36,14 @@ typedef enum {
/* git_cred_ssh_interactive */
GIT_CREDTYPE_SSH_INTERACTIVE = (1u << 4),
+
+ /**
+ * Username-only information
+ *
+ * If the SSH transport does not know which username to use,
+ * it will ask via this credential type.
+ */
+ GIT_CREDTYPE_USERNAME = (1u << 5),
} git_credtype_t;
/* The base structure for all credential types */
@@ -103,6 +111,12 @@ typedef struct git_cred_ssh_custom {
/** A key for NTLM/Kerberos "default" credentials */
typedef struct git_cred git_cred_default;
+/** Username-only credential information */
+typedef struct git_cred_username {
+ git_cred parent;
+ char username[1];
+} git_cred_username;
+
/**
* Check whether a credential object contains username information.
*
@@ -205,6 +219,14 @@ GIT_EXTERN(int) git_cred_ssh_custom_new(
GIT_EXTERN(int) git_cred_default_new(git_cred **out);
/**
+ * Create a credential to specify a username.
+ *
+ * This is used with ssh authentication to query for the username if
+ * none is specified in the url.
+ */
+GIT_EXTERN(int) git_cred_username_new(git_cred **cred, const char *username);
+
+/**
* Signature of a function which acquires a credential object.
*
* - cred: The newly created credential object.