summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgitk5
1 files changed, 4 insertions, 1 deletions
diff --git a/gitk b/gitk
index b0a76dd225..769c79ab07 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