From: Matt Draisey Date: Thu, 19 Jan 2006 20:58:03 GMT Subject: [PATCH] local push/pull env cleanup Message-ID: <20060119205803.308.78669.stgit@della.draisey.ca> From: Matt Draisey remove environment variables relating to the current repository before execing the 'remote' half of a local push or pull operation --- connect.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/connect.c b/connect.c index d6f4e4c..50cc879 100644 --- a/connect.c +++ b/connect.c @@ -644,8 +644,13 @@ int git_connect(int fd[2], char *url, co ssh_basename++; execlp(ssh, ssh_basename, host, command, NULL); } - else + else { + unsetenv("GIT_DIR"); + unsetenv("GIT_INDEX_FILE"); + unsetenv("GIT_OBJECT_DIRECTORY"); + unsetenv("GIT_ALTERNATE_OBJECT_DIRECTORIES"); execlp("sh", "sh", "-c", command, NULL); + } die("exec failed"); } fd[0] = pipefd[0][0];