From 151a9df03b2c0a84ede76db4bbf6b866c3c6f88a Mon Sep 17 00:00:00 2001 From: Max Kirillov Date: Wed, 18 Jan 2017 21:01:09 +0200 Subject: [PATCH] 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 Signed-off-by: Johannes Schindelin --- git-gui/git-gui.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh index 99d64e39de..46de3eab9d 100755 --- a/git-gui/git-gui.sh +++ b/git-gui/git-gui.sh @@ -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