From 448b5a9e4c1e9338254419181c0343d126a538fa Mon Sep 17 00:00:00 2001 From: Remy Bohmer Date: Fri, 20 Mar 2020 11:05:29 +0100 Subject: [PATCH] [fix] Gitk fails to open on a bare Git repository on Windows Running 'git rev-parse --show-toplevel' fails on a bare git repo. This causes gitk to fail to startup. Signed-off-by: Remy Bohmer --- gitk-git/gitk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gitk-git/gitk b/gitk-git/gitk index b805ec53ed0571..cd681dc4c46257 100755 --- a/gitk-git/gitk +++ b/gitk-git/gitk @@ -12631,7 +12631,9 @@ set cdup {} if {[expr {[exec git rev-parse --is-inside-work-tree] == "true"}]} { set cdup [exec git rev-parse --show-cdup] } -set worktree [exec git rev-parse --show-toplevel] +if {$hasworktree} { + set worktree [exec git rev-parse --show-toplevel] +} setcoords makewindow if {$::tcl_platform(platform) eq {windows} && [file exists $gitk_prefix/etc/git.ico]} {