@matheusbsbs / matheus-bagliano / commits / 6c87d60cc6
Fork 0

[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>

Alex Riesen committed Jul 29, 2007 at 22:29 UTC 6c87d60cc6202d4de5ac6d136394602feefeafc6
1 file changed +4 -1
gitk
+4 -1
@@ -7636,7 +7636,10 @@ catch {source ~/.gitk}
7636 font create optionfont -family sans-serif -size -12
7637
7638 # check that we can find a .git directory somewhere...
7639 -set gitdir [gitdir]
7639 +if {[catch {set gitdir [gitdir]}]} {
7640 + show_error {} . "Cannot find a git repository here."
7641 + exit 1
7642 +}
7643 if {![file isdirectory $gitdir]} {
7644 show_error {} . "Cannot find the git directory \"$gitdir\"."
7645 exit 1