summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4ef1753)
raw | patch | inline | side by side (parent: 4ef1753)
author | Junio C Hamano <junkio@cox.net> | |
Thu, 28 Jul 2005 07:28:44 +0000 (00:28 -0700) | ||
committer | Paul Mackerras <paulus@samba.org> | |
Thu, 28 Jul 2005 12:29:59 +0000 (07:29 -0500) |
Some places assumed .git is the GIT_DIR, resulting heads and
tags not showing when it was run like "GIT_DIR=. gitk --all".
This is not a contrived example --- I rely on it to verify
my private copy of git.git repository before pushing it out.
Define a single procedure "gitdir" and use it.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
tags not showing when it was run like "GIT_DIR=. gitk --all".
This is not a contrived example --- I rely on it to verify
my private copy of git.git repository before pushing it out.
Define a single procedure "gitdir" and use it.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk | patch | blob | history |
index 96600b60d693f6cb6c60ad4a4c1f54f11a5468c9..dd8f1f1494bab7c83121e31927b306cec2ea564e 100755 (executable)
--- a/gitk
+++ b/gitk
# and distributed under the terms of the GNU General Public Licence,
# either version 2, or (at your option) any later version.
+proc gitdir {} {
+ global env
+ if {[info exists env(GIT_DIR)]} {
+ return $env(GIT_DIR)
+ } else {
+ return ".git"
+ }
+}
+
proc getcommits {rargs} {
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"
- }
+ set gitdir [gitdir]
if {![file isdirectory $gitdir]} {
error_popup "Cannot find the git directory \"$gitdir\"."
exit 1
proc readrefs {} {
global tagids idtags headids idheads
- set tags [glob -nocomplain -types f .git/refs/tags/*]
+ set tags [glob -nocomplain -types f [gitdir]/refs/tags/*]
foreach f $tags {
catch {
set fd [open $f r]
close $fd
}
}
- set heads [glob -nocomplain -types f .git/refs/heads/*]
+ set heads [glob -nocomplain -types f [gitdir]/refs/heads/*]
foreach f $heads {
catch {
set fd [open $f r]
return
}
if {[catch {
- set dir ".git"
- if {[info exists env(GIT_DIR)]} {
- set dir $env(GIT_DIR)
- }
+ set dir [gitdir]
set fname [file join $dir "refs/tags" $tag]
set f [open $fname w]
puts $f $id