From: Alex Riesen Date: Sun, 29 Jul 2007 20:29:45 +0000 (+0200) Subject: [PATCH] gitk: Show an error and exit if no .git could be found X-Git-Tag: v1.5.3-rc5~24^2~2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6c87d60cc6202d4de5ac6d136394602feefeafc6;p=git.git [PATCH] gitk: Show an error and exit if no .git could be found This is to help people starting gitk from graphical file managers where the stderr output is hidden. Signed-off-by: Alex Riesen Signed-off-by: Paul Mackerras --- diff --git a/gitk b/gitk index b0a76dd22..769c79ab0 100755 --- a/gitk +++ b/gitk @@ -7636,7 +7636,10 @@ catch {source ~/.gitk} font create optionfont -family sans-serif -size -12 # check that we can find a .git directory somewhere... -set gitdir [gitdir] +if {[catch {set gitdir [gitdir]}]} { + show_error {} . "Cannot find a git repository here." + exit 1 +} if {![file isdirectory $gitdir]} { show_error {} . "Cannot find the git directory \"$gitdir\"." exit 1