local push/pull env cleanup
remove environment variables relating to the current repository before execing the 'remote' half of a local push or pull operation [jc: the original from Matt spelled out the environment variable names, which I changed to the preprocessor symbols defined in cache.h. Also it missed GRAFT_ENVIRONMENT.] Signed-off-by: Junio C Hamano <junkio@cox.net>
Matt Draisey committed
Jan 19, 2006 at 15:58 UTC
016fb48bc480dde83b57466f59f633cbc5128ae6
1 file changed
+8
-2
connect.c
+8
-2
@@ -644,10 +644,16 @@ int git_connect(int fd[2], char *url, const char *prog)
644
ssh_basename++;
645
execlp(ssh, ssh_basename, host, command, NULL);
646
}
647
- else
647
+ else {
648
+ unsetenv(ALTERNATE_DB_ENVIRONMENT);
649
+ unsetenv(DB_ENVIRONMENT);
650
+ unsetenv(GIT_DIR_ENVIRONMENT);
651
+ unsetenv(GRAFT_ENVIRONMENT);
652
+ unsetenv(INDEX_ENVIRONMENT);
653
execlp("sh", "sh", "-c", command, NULL);
654
+ }
655
die("exec failed");
650
- }
656
+ }
657
fd[0] = pipefd[0][0];
658
fd[1] = pipefd[1][1];
659
close(pipefd[0][1]);