summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXidorn Quan <quanxunzhen@gmail.com>2013-05-28 02:36:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-05-28 18:29:47 (GMT)
commitde56ccf7999ca53370f44f252b780a970d639f9e (patch)
treeeadc8c93b4a9a2c8d798b95833be80b93637eb46
parentedca4152560522a431a51fc0a06147fc680b5b18 (diff)
downloadgit-de56ccf7999ca53370f44f252b780a970d639f9e.zip
git-de56ccf7999ca53370f44f252b780a970d639f9e.tar.gz
git-de56ccf7999ca53370f44f252b780a970d639f9e.tar.bz2
credential-osxkeychain: support more protocols
Add protocol imap, imaps, ftp and smtp for credential-osxkeychain. Signed-off-by: Xidorn Quan <quanxunzhen@gmail.com> Acked-by: John Szakmeister <john@szakmeister.net> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--contrib/credential/osxkeychain/git-credential-osxkeychain.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/contrib/credential/osxkeychain/git-credential-osxkeychain.c b/contrib/credential/osxkeychain/git-credential-osxkeychain.c
index 3940202..bcd3f57 100644
--- a/contrib/credential/osxkeychain/git-credential-osxkeychain.c
+++ b/contrib/credential/osxkeychain/git-credential-osxkeychain.c
@@ -127,10 +127,20 @@ static void read_credential(void)
*v++ = '\0';
if (!strcmp(buf, "protocol")) {
- if (!strcmp(v, "https"))
+ if (!strcmp(v, "imap"))
+ protocol = kSecProtocolTypeIMAP;
+ else if (!strcmp(v, "imaps"))
+ protocol = kSecProtocolTypeIMAPS;
+ else if (!strcmp(v, "ftp"))
+ protocol = kSecProtocolTypeFTP;
+ else if (!strcmp(v, "ftps"))
+ protocol = kSecProtocolTypeFTPS;
+ else if (!strcmp(v, "https"))
protocol = kSecProtocolTypeHTTPS;
else if (!strcmp(v, "http"))
protocol = kSecProtocolTypeHTTP;
+ else if (!strcmp(v, "smtp"))
+ protocol = kSecProtocolTypeSMTP;
else /* we don't yet handle other protocols */
exit(0);
}