From e64a88ac7bdd1b25c12ecf3327f6738369c5bac1 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 abe4805adedb3c..31f4083c735c24 100755 --- a/gitk-git/gitk +++ b/gitk-git/gitk @@ -12599,7 +12599,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 catch {