diff options
| author | Carlos Martín Nieto <cmn@dwim.me> | 2014-08-27 15:10:51 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <cmn@dwim.me> | 2014-08-27 15:10:51 +0200 |
| commit | 15c7da3442843b8fd2cdb95af8716ec6b5c12a40 (patch) | |
| tree | b7a0dfb73f7311283e1469182c6aaeff48e00fb9 /include | |
| parent | cb92467bc284b87c38cdf32f8803a528846d094b (diff) | |
| parent | 7449c82ee713024f59badf6fef9cc0ac49ce9561 (diff) | |
| download | libgit2-15c7da3442843b8fd2cdb95af8716ec6b5c12a40.tar.gz | |
Merge branch 'cmn/ssh-retry'
Diffstat (limited to 'include')
| -rw-r--r-- | include/git2/errors.h | 1 | ||||
| -rw-r--r-- | include/git2/transport.h | 22 |
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. |
