Skip to content

Commit 4fe021b

Browse files
max630Git for Windows Build Agent
authored andcommitted
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 <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
1 parent b1c8387 commit 4fe021b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

git-gui/git-gui.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2210,6 +2210,8 @@ proc do_gitk {revs {is_submodule false}} {
22102210
22112211
if {$old_GIT_DIR ne {}} {
22122212
set env(GIT_DIR) $old_GIT_DIR
2213+
} else {
2214+
unset env(GIT_DIR)
22132215
}
22142216
cd $pwd
22152217

0 commit comments

Comments
 (0)