summaryrefslogtreecommitdiff
path: root/builtin/credential.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/credential.c')
-rw-r--r--builtin/credential.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/builtin/credential.c b/builtin/credential.c
index 14c8c6608b..a295c80b36 100644
--- a/builtin/credential.c
+++ b/builtin/credential.c
@@ -3,6 +3,7 @@
#include "git-compat-util.h"
#include "credential.h"
#include "builtin.h"
+#include "environment.h"
#include "config.h"
static const char usage_msg[] =
@@ -16,9 +17,10 @@ int cmd_credential(int argc,
const char *op;
struct credential c = CREDENTIAL_INIT;
- git_config(git_default_config, NULL);
+ repo_config(the_repository, git_default_config, NULL);
- if (argc != 2 || !strcmp(argv[1], "-h"))
+ show_usage_if_asked(argc, argv, usage_msg);
+ if (argc != 2)
usage(usage_msg);
op = argv[1];
@@ -32,15 +34,15 @@ int cmd_credential(int argc,
die("unable to read credential from stdin");
if (!strcmp(op, "fill")) {
- credential_fill(&c, 0);
+ credential_fill(the_repository, &c, 0);
credential_next_state(&c);
credential_write(&c, stdout, CREDENTIAL_OP_RESPONSE);
} else if (!strcmp(op, "approve")) {
credential_set_all_capabilities(&c, CREDENTIAL_OP_HELPER);
- credential_approve(&c);
+ credential_approve(the_repository, &c);
} else if (!strcmp(op, "reject")) {
credential_set_all_capabilities(&c, CREDENTIAL_OP_HELPER);
- credential_reject(&c);
+ credential_reject(the_repository, &c);
} else {
usage(usage_msg);
}