Skip to content

Commit da616db

Browse files
Martin von Zweigbergkpaulusmack
authored andcommitted
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 <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent 929f577 commit da616db

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

gitk

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9059,6 +9059,7 @@ proc exec_citool {tool_args {baseid {}}} {
90599059
proc cherrypick {} {
90609060
global rowmenuid curview
90619061
global mainhead mainheadid
9062+
global gitdir
90629063

90639064
set oldhead [exec git rev-parse HEAD]
90649065
set dheads [descheads $rowmenuid]
@@ -9087,7 +9088,7 @@ proc cherrypick {} {
90879088
conflict.\nDo you wish to run git citool to\
90889089
resolve it?"]]} {
90899090
# Force citool to read MERGE_MSG
9090-
file delete [file join [gitdir] "GITGUI_MSG"]
9091+
file delete [file join $gitdir "GITGUI_MSG"]
90919092
exec_citool {} $rowmenuid
90929093
}
90939094
} else {
@@ -9453,14 +9454,15 @@ proc refill_reflist {} {
94539454
proc getallcommits {} {
94549455
global allcommits nextarc seeds allccache allcwait cachedarcs allcupdate
94559456
global idheads idtags idotherrefs allparents tagobjid
9457+
global gitdir
94569458

94579459
if {![info exists allcommits]} {
94589460
set nextarc 0
94599461
set allcommits 0
94609462
set seeds {}
94619463
set allcwait 0
94629464
set cachedarcs 0
9463-
set allccache [file join [gitdir] "gitk.cache"]
9465+
set allccache [file join $gitdir "gitk.cache"]
94649466
if {![catch {
94659467
set f [open $allccache r]
94669468
set allcwait 1

0 commit comments

Comments
 (0)