From e30b2feb1b50c2d14d32dc3e6e41f7b20a677ff2 Mon Sep 17 00:00:00 2001 From: Javier Roucher Iglesias Date: Sun, 24 Jun 2012 13:39:59 +0200 Subject: add 'git credential' plumbing command The credential API is in C, and not available to scripting languages. Expose the functionalities of the API by wrapping them into a new plumbing command "git credentials". In other words, replace the internal "test-credential" by an official Git command. Most documentation writen by: Jeff King Signed-off-by: Pavel Volek Signed-off-by: Kim Thuat Nguyen Signed-off-by: Javier Roucher Iglesias Signed-off-by: Matthieu Moy Signed-off-by: Junio C Hamano --- test-credential.c | 38 -------------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 test-credential.c (limited to 'test-credential.c') diff --git a/test-credential.c b/test-credential.c deleted file mode 100644 index dee200e7f2..0000000000 --- a/test-credential.c +++ /dev/null @@ -1,38 +0,0 @@ -#include "cache.h" -#include "credential.h" -#include "string-list.h" - -static const char usage_msg[] = -"test-credential [helper...]"; - -int main(int argc, const char **argv) -{ - const char *op; - struct credential c = CREDENTIAL_INIT; - int i; - - op = argv[1]; - if (!op) - usage(usage_msg); - for (i = 2; i < argc; i++) - string_list_append(&c.helpers, argv[i]); - - if (credential_read(&c, stdin) < 0) - die("unable to read credential from stdin"); - - if (!strcmp(op, "fill")) { - credential_fill(&c); - if (c.username) - printf("username=%s\n", c.username); - if (c.password) - printf("password=%s\n", c.password); - } - else if (!strcmp(op, "approve")) - credential_approve(&c); - else if (!strcmp(op, "reject")) - credential_reject(&c); - else - usage(usage_msg); - - return 0; -} -- cgit v1.2.1