summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ee3dc72)
raw | patch | inline | side by side (parent: ee3dc72)
author | Paul Mackerras <paulus@samba.org> | |
Mon, 27 Jun 2005 00:37:11 +0000 (10:37 +1000) | ||
committer | Paul Mackerras <paulus@samba.org> | |
Mon, 27 Jun 2005 00:37:11 +0000 (10:37 +1000) |
Check that $GIT_DIR (or .git, if GIT_DIR is not set) is a directory.
This means we can give a more informative error message if the user
runs gitk somewhere that isn't a git repository.
This means we can give a more informative error message if the user
runs gitk somewhere that isn't a git repository.
gitk | patch | blob | history |
index 9ad7bfc7e164b7d6194ddf0a8ed08b9ea708b98f..b44144870d5dc9836b225dfdd8553c0effeec43e 100755 (executable)
--- a/gitk
+++ b/gitk
# either version 2, or (at your option) any later version.
proc getcommits {rargs} {
- global commits commfd phase canv mainfont
+ global commits commfd phase canv mainfont env
global startmsecs nextupdate
global ctext maincursor textcursor leftover
+ # check that we can find a .git directory somewhere...
+ if {[info exists env(GIT_DIR)]} {
+ set gitdir $env(GIT_DIR)
+ } else {
+ set gitdir ".git"
+ }
+ if {![file isdirectory $gitdir]} {
+ error_popup "Cannot find the git directory \"$gitdir\"."
+ exit 1
+ }
set commits {}
set phase getcommits
set startmsecs [clock clicks -milliseconds]