Skip to content

Commit 2df6442

Browse files
angavrilovpaulusmack
authored andcommitted
gitk: Fix file list context menu for merge commits
Currently it displays an ugly error box, because the treediffs array is not filled for such commits. This fixes it by making getmergediffline add the filenames it sees to the treediffs array like gettreediffline does. Signed-off-by: Alexander Gavrilov <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent bee866f commit 2df6442

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
@@ -6418,14 +6418,15 @@ proc getblobline {bf id} {
64186418

64196419
proc mergediff {id} {
64206420
global diffmergeid mdifffd
6421-
global diffids
6421+
global diffids treediffs
64226422
global parents
64236423
global diffcontext
64246424
global diffencoding
64256425
global limitdiffs vfilelimit curview
64266426

64276427
set diffmergeid $id
64286428
set diffids $id
6429+
set treediffs($id) {}
64296430
# this doesn't seem to actually affect anything...
64306431
set cmd [concat | git diff-tree --no-commit-id --cc -U$diffcontext $id]
64316432
if {$limitdiffs && $vfilelimit($curview) ne {}} {
@@ -6445,7 +6446,7 @@ proc mergediff {id} {
64456446

64466447
proc getmergediffline {mdf id np} {
64476448
global diffmergeid ctext cflist mergemax
6448-
global difffilestart mdifffd
6449+
global difffilestart mdifffd treediffs
64496450
global diffencoding
64506451

64516452
$ctext conf -state normal
@@ -6462,6 +6463,7 @@ proc getmergediffline {mdf id np} {
64626463
$ctext insert end "\n"
64636464
set here [$ctext index "end - 1c"]
64646465
lappend difffilestart $here
6466+
lappend treediffs($id) $fname
64656467
add_flist [list $fname]
64666468
set diffencoding [get_path_encoding $fname]
64676469
set l [expr {(78 - [string length $fname]) / 2}]

0 commit comments

Comments
 (0)