summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8f321a3)
raw | patch | inline | side by side (parent: 8f321a3)
author | Junio C Hamano <gitster@pobox.com> | |
Tue, 6 Nov 2007 20:23:14 +0000 (12:23 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 6 Nov 2007 20:23:14 +0000 (12:23 -0800) |
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>
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>
builtin-rev-parse.c | patch | blob | history | |
git.c | patch | blob | history |
diff --git a/builtin-rev-parse.c b/builtin-rev-parse.c
index 054519bf281e1522a815329fc944ce067801ea2d..d1038a0e66edf728fbba9476b3b9f443647c612c 100644 (file)
--- a/builtin-rev-parse.c
+++ b/builtin-rev-parse.c
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];
index 4e10581101c26444da5c7c44a80219b11607705b..b843da4d424d23d2855d84f55eef52e8a3fa1bb7 100644 (file)
--- a/git.c
+++ b/git.c
{ "rerere", cmd_rerere, RUN_SETUP },
{ "reset", cmd_reset, RUN_SETUP },
{ "rev-list", cmd_rev_list, RUN_SETUP },
- { "rev-parse", cmd_rev_parse, RUN_SETUP },
+ { "rev-parse", cmd_rev_parse },
{ "revert", cmd_revert, RUN_SETUP | NEED_WORK_TREE },
{ "rm", cmd_rm, RUN_SETUP | NEED_WORK_TREE },
{ "runstatus", cmd_runstatus, RUN_SETUP | NEED_WORK_TREE },