aboutsummaryrefslogtreecommitdiff
path: root/builtin-rev-parse.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-11-06 12:23:14 -0800
committerJunio C Hamano <gitster@pobox.com>2007-11-06 12:23:14 -0800
commit5410a02ab9e6a1987147724f8ea65e6a077b3832 (patch)
treee21b1a63136ab205c8796b0a560dacc475d085a5 /builtin-rev-parse.c
parent8f321a39257a06db014a3b6ae5dce839821cdb16 (diff)
downloadgit-5410a02ab9e6a1987147724f8ea65e6a077b3832.tar.gz
git-5410a02ab9e6a1987147724f8ea65e6a077b3832.tar.xz
git-rev-parse --parseopt
The "parseopt mode" of git-rev-parse does not need to be run inside a git repository, although the normal mode does. Most notabily, lack of this fix breaks git-clone script, as noticed by Nico. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-rev-parse.c')
-rw-r--r--builtin-rev-parse.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin-rev-parse.c b/builtin-rev-parse.c
index 054519bf2..d1038a0e6 100644
--- a/builtin-rev-parse.c
+++ b/builtin-rev-parse.c
@@ -337,11 +337,11 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
int i, as_is = 0, verify = 0;
unsigned char sha1[20];
- git_config(git_default_config);
-
if (argc > 1 && !strcmp("--parseopt", argv[1]))
return cmd_parseopt(argc - 1, argv + 1, prefix);
+ prefix = setup_git_directory();
+ git_config(git_default_config);
for (i = 1; i < argc; i++) {
const char *arg = argv[i];