gitk: Run 'git rev-parse --git-dir' only once
It seems like gitk has been setting the global variable 'gitdir' at startup since aa81d97 (gitk: Fix Update menu item, 2006-02-28). It should therefore no longer be necessary to call the procedure with the same name (more than once to set the global variable). Remove the other call sites and use the global variable instead. Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Martin von Zweigbergk committed
Apr 4, 2011 at 22:14 UTC
da616db5e56a735ab3028c33b19af5136420dcb9
1 file changed
+4
-2
gitk
+4
-2
@@ -9059,6 +9059,7 @@ proc exec_citool {tool_args {baseid {}}} {
9059
proc cherrypick {} {
9060
global rowmenuid curview
9061
global mainhead mainheadid
9062
+ global gitdir
9063
9064
set oldhead [exec git rev-parse HEAD]
9065
set dheads [descheads $rowmenuid]
@@ -9087,7 +9088,7 @@ proc cherrypick {} {
9088
conflict.\nDo you wish to run git citool to\
9089
resolve it?"]]} {
9090
# Force citool to read MERGE_MSG
9090
- file delete [file join [gitdir] "GITGUI_MSG"]
9091
+ file delete [file join $gitdir "GITGUI_MSG"]
9092
exec_citool {} $rowmenuid
9093
}
9094
} else {
@@ -9453,6 +9454,7 @@ proc refill_reflist {} {
9454
proc getallcommits {} {
9455
global allcommits nextarc seeds allccache allcwait cachedarcs allcupdate
9456
global idheads idtags idotherrefs allparents tagobjid
9457
+ global gitdir
9458
9459
if {![info exists allcommits]} {
9460
set nextarc 0
@@ -9460,7 +9462,7 @@ proc getallcommits {} {
9462
set seeds {}
9463
set allcwait 0
9464
set cachedarcs 0
9463
- set allccache [file join [gitdir] "gitk.cache"]
9465
+ set allccache [file join $gitdir "gitk.cache"]
9466
if {![catch {
9467
set f [open $allccache r]
9468
set allcwait 1