Commands requiring a work tree must not run in GIT_DIR
This patch helps when you accidentally run something like git-clean in the git directory instead of the work tree. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
committed by
Junio C Hamano
parent
98d47d4ccf
commit
6d9ba67b0f
@ -347,6 +347,11 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
|
||||
printf("%s/.git\n", cwd);
|
||||
continue;
|
||||
}
|
||||
if (!strcmp(arg, "--is-inside-git-dir")) {
|
||||
printf("%s\n", is_inside_git_dir() ? "true"
|
||||
: "false");
|
||||
continue;
|
||||
}
|
||||
if (!strncmp(arg, "--since=", 8)) {
|
||||
show_datestring("--max-age=", arg+8);
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user