From 848db13b63b4d58720895a2a2bf60f4e81c626e3 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 0787c10fcd86b4..ccf057966a18f3 100755 --- a/git-gui/git-gui.sh +++ b/git-gui/git-gui.sh @@ -2209,6 +2209,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