[PATCH v3 02/12] git-gui: remove unnecessary 'cd $_gitworktree' from do_gitk
- From
Mark Levedahl <mlevedahl@gmail.com>
- Date
- May 31, 2026, 23:02 UTC
- Message-ID
- <20260531230225.126817-3-mlevedahl@gmail.com>
- In-Reply-To
- <20260531230225.126817-1-mlevedahl@gmail.com>
From: Johannes Sixt <j6t@kdbg.org>
In the procedure that invokes Gitk, we have a 'cd $_gitworktree'. Such a change of the current directory is not necessary, because
- if we have a working tree, then the startup routine has already changed the current directory to the root of the working tree, which *is* $_gitworktree; or
- if we are in a bare repository, then there is no point in changing the current directory anywhere. (And $_gitworktree is empty.)
Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Mark Levedahl <mlevedahl@gmail.com> --- git-gui.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/git-gui.sh b/git-gui.sh index f70a54a61b..52897fbd09 100755 --- a/git-gui.sh +++ b/git-gui.sh @@ -2024,11 +2024,7 @@ proc do_gitk {revs {is_submodule false}} { set pwd [pwd] - if {!$is_submodule} { - if {![is_bare]} { - cd $_gitworktree - } - } else { + if {$is_submodule} { cd $current_diff_path if {$revs eq {--}} { set s $file_states($current_diff_path)
-- 2.54.0.99.14