diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2014-06-08 16:37:10 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-06-10 12:00:53 -0700 |
commit | c0562611c525bb3c564b79c345fc7e4f9e799e54 (patch) | |
tree | bb3e755cde8b269e23f0db2cdb4cafa63deb9fc3 /t/t0001-init.sh | |
parent | e156455ea49124c140a67623f22a393db62d5d98 (diff) | |
download | git-c0562611c525bb3c564b79c345fc7e4f9e799e54.tar.gz |
git potty: restore environments after alias expansionnd/init-restore-env
Commit 4ad8332 (t0001: test git init when run via an alias -
2010-11-26) noted breakages when running init via alias. The problem
is for alias to be used, $GIT_DIR must be searched, but 'init' and
'clone' are not happy with that. So we start a new process like an
external command, with clean environment in this case. Env variables
that are set by command line (e.g. "git --git-dir=.. ") are kept.
This should also fix autocorrecting a command typo to "init" because
it's the same problem: aliases are read, then "init" is unhappy with
$GIT_DIR already set up because of that.
Reminded-by: David Turner <dturner@twopensource.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0001-init.sh')
-rwxr-xr-x | t/t0001-init.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t0001-init.sh b/t/t0001-init.sh index bbc9cb60dd..b8c0ffff8b 100755 --- a/t/t0001-init.sh +++ b/t/t0001-init.sh @@ -56,7 +56,7 @@ test_expect_success 'plain through aliased command, outside any git repo' ' check_config plain-aliased/.git false unset ' -test_expect_failure 'plain nested through aliased command' ' +test_expect_success 'plain nested through aliased command' ' ( git init plain-ancestor-aliased && cd plain-ancestor-aliased && @@ -68,7 +68,7 @@ test_expect_failure 'plain nested through aliased command' ' check_config plain-ancestor-aliased/plain-nested/.git false unset ' -test_expect_failure 'plain nested in bare through aliased command' ' +test_expect_success 'plain nested in bare through aliased command' ' ( git init --bare bare-ancestor-aliased.git && cd bare-ancestor-aliased.git && |