summaryrefslogtreecommitdiff
path: root/builtin-rev-parse.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2007-01-23 12:30:20 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-02-05 22:02:16 (GMT)
commit6d9ba67b0fc2f18c1d7a65514edbdcdf86429c1c (patch)
treeed60e9bec4aa2adc5aecde724614f3fa4a542971 /builtin-rev-parse.c
parent98d47d4ccf76725e7833c1bbda1da82f7648925f (diff)
downloadgit-6d9ba67b0fc2f18c1d7a65514edbdcdf86429c1c.zip
git-6d9ba67b0fc2f18c1d7a65514edbdcdf86429c1c.tar.gz
git-6d9ba67b0fc2f18c1d7a65514edbdcdf86429c1c.tar.bz2
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>
Diffstat (limited to 'builtin-rev-parse.c')
-rw-r--r--builtin-rev-parse.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/builtin-rev-parse.c b/builtin-rev-parse.c
index 3b716fb..d53deaa 100644
--- a/builtin-rev-parse.c
+++ b/builtin-rev-parse.c
@@ -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;