summaryrefslogtreecommitdiff
path: root/gitk
diff options
context:
space:
mode:
authorAlex Riesen <raa.lkml@gmail.com>2007-07-29 20:29:45 (GMT)
committerPaul Mackerras <paulus@samba.org>2007-08-12 07:30:57 (GMT)
commit6c87d60cc6202d4de5ac6d136394602feefeafc6 (patch)
tree5bb20d4b7ea1d7b64378ba8846dadbfea8414f35 /gitk
parent062d671f57a422863416ee4c746ef74c1cc45c19 (diff)
downloadgit-6c87d60cc6202d4de5ac6d136394602feefeafc6.zip
git-6c87d60cc6202d4de5ac6d136394602feefeafc6.tar.gz
git-6c87d60cc6202d4de5ac6d136394602feefeafc6.tar.bz2
[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 <raa.lkml@gmail.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'gitk')
-rwxr-xr-xgitk5
1 files changed, 4 insertions, 1 deletions
diff --git a/gitk b/gitk
index b0a76dd..769c79a 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