From 2492bb43f18b7cbccd424998201f75c0aad264ac 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 f3c7f6cef9..8ccaaa77cf 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