--- builtin-help.c | 2 +- git.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/builtin-help.c b/builtin-help.c index 7470faa..db233eb 100644 --- a/builtin-help.c +++ b/builtin-help.c @@ -10,7 +10,7 @@ #include "exec_cmd.h" #include "common-cmds.h" static const char git_usage[] = - "Usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [--help] COMMAND [ ARGS ]"; + "Usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [--git-dir=GIT_DIR] [--help] COMMAND [ ARGS ]"; /* most gui terms set COLUMNS (although some don't export it) */ static int term_columns(void) diff --git a/git.c b/git.c index 94e9a4a..d49f626 100644 --- a/git.c +++ b/git.c @@ -277,6 +277,12 @@ int main(int argc, const char **argv, ch puts(git_exec_path()); exit(0); } + + if (!strncmp(cmd, "git-dir=", 8)) { + setenv("GIT_DIR", cmd + 8, 1); + continue; + } + cmd_usage(0, NULL, NULL); } argv[0] = cmd; -- 1.4.0 - : send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html