summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-02-04 14:49:28 -0800
committerRussell Belfer <rb@github.com>2013-02-04 14:49:28 -0800
commitde81aee3907e3737ad87e88e14b702f4b3bf12a6 (patch)
treee3c8c35378bf5c4c5f922b39d3dc168d1657097e /include/git2
parent3261a3e980b00cf19b971c078d09bc0660ce1f81 (diff)
parent630146bd1b71cbb450f1fe658048ca8e25479105 (diff)
downloadlibgit2-de81aee3907e3737ad87e88e14b702f4b3bf12a6.tar.gz
Merge pull request #1298 from ben/user-at
Handle "user@" prefix for credentials partially included in URLs
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/cred_helpers.h3
-rw-r--r--include/git2/transport.h3
2 files changed, 6 insertions, 0 deletions
diff --git a/include/git2/cred_helpers.h b/include/git2/cred_helpers.h
index 7c213c8dd..e3eb91d6c 100644
--- a/include/git2/cred_helpers.h
+++ b/include/git2/cred_helpers.h
@@ -34,6 +34,8 @@ typedef struct git_cred_userpass_payload {
*
* @param cred The newly created credential object.
* @param url The resource for which we are demanding a credential.
+ * @param username_from_url The username that was embedded in a "user@host"
+ * remote url, or NULL if not included.
* @param allowed_types A bitmask stating which cred types are OK to return.
* @param payload The payload provided when specifying this callback. (This is
* interpreted as a `git_cred_userpass_payload*`.)
@@ -41,6 +43,7 @@ typedef struct git_cred_userpass_payload {
GIT_EXTERN(int) git_cred_userpass(
git_cred **cred,
const char *url,
+ const char *user_from_url,
unsigned int allowed_types,
void *payload);
diff --git a/include/git2/transport.h b/include/git2/transport.h
index 4945ff151..469b43f72 100644
--- a/include/git2/transport.h
+++ b/include/git2/transport.h
@@ -62,6 +62,8 @@ GIT_EXTERN(int) git_cred_userpass_plaintext_new(
*
* @param cred The newly created credential object.
* @param url The resource for which we are demanding a credential.
+ * @param username_from_url The username that was embedded in a "user@host"
+ * remote url, or NULL if not included.
* @param allowed_types A bitmask stating which cred types are OK to return.
* @param payload The payload provided when specifying this callback.
* @return 0 for success or an error code for failure
@@ -69,6 +71,7 @@ GIT_EXTERN(int) git_cred_userpass_plaintext_new(
typedef int (*git_cred_acquire_cb)(
git_cred **cred,
const char *url,
+ const char *username_from_url,
unsigned int allowed_types,
void *payload);