git-gui: correctly restore GIT_DIR after invoking gitk

git-gui tries to temporary set GIT_DIR for starting gitk and restore
it back after they are started. But in case of GIT_DIR which was not set
prior to invocation it is not unset after it. This affects commands
which can be later started from that git gui, for example "Git Bash".

Fix it.

Signed-off-by: Max Kirillov <max@max630.net>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Max Kirillov
2017-01-18 21:01:09 +02:00
committed by Johannes Schindelin
parent eb6afc451b
commit 00f7dda82b

View File

@@ -2208,6 +2208,8 @@ proc do_gitk {revs {is_submodule false}} {
if {$old_GIT_DIR ne {}} {
set env(GIT_DIR) $old_GIT_DIR
} else {
unset env(GIT_DIR)
}
cd $pwd