Merge branch 'nd/clear-gitenv-upon-use-of-alias'
authorJunio C Hamano <gitster@pobox.com>
Wed, 20 Jan 2016 19:43:26 +0000 (11:43 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 20 Jan 2016 19:43:26 +0000 (11:43 -0800)
d95138e6 (setup: set env $GIT_WORK_TREE when work tree is set, like
$GIT_DIR, 2015-06-26) attempted to work around a glitch in alias
handling by overwriting GIT_WORK_TREE environment variable to
affect subprocesses when set_git_work_tree() gets called, which
resulted in a rather unpleasant regression to "clone" and "init".
Try to address the same issue by always restoring the environment
and respawning the real underlying command when handling alias.

* nd/clear-gitenv-upon-use-of-alias:
run-command: don't warn on SIGPIPE deaths
git.c: make sure we do not leak GIT_* to alias scripts
setup.c: re-fix d95138e (setup: set env $GIT_WORK_TREE when ..
git.c: make it clear save_env() is for alias handling only

1  2 
git.c
run-command.c
t/t0001-init.sh
t/t0002-gitfile.sh
t/t5601-clone.sh
diff --cc git.c
index 6ed824cacfccddcb01104835b45ab934ff3f443e,98d441220a29f2b660a0bb37412ff1ec98453412..da278c3d41ed308581ffec46e3487e7670898d41
--- 1/git.c
--- 2/git.c
+++ b/git.c
@@@ -415,9 -416,9 +417,9 @@@ static struct cmd_struct commands[] = 
        { "hash-object", cmd_hash_object },
        { "help", cmd_help },
        { "index-pack", cmd_index_pack, RUN_SETUP_GENTLY },
-       { "init", cmd_init_db, NO_SETUP },
-       { "init-db", cmd_init_db, NO_SETUP },
+       { "init", cmd_init_db },
+       { "init-db", cmd_init_db },
 -      { "interpret-trailers", cmd_interpret_trailers, RUN_SETUP },
 +      { "interpret-trailers", cmd_interpret_trailers, RUN_SETUP_GENTLY },
        { "log", cmd_log, RUN_SETUP },
        { "ls-files", cmd_ls_files, RUN_SETUP },
        { "ls-remote", cmd_ls_remote, RUN_SETUP_GENTLY },
diff --cc run-command.c
Simple merge
diff --cc t/t0001-init.sh
Simple merge
Simple merge
Simple merge