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 <angavrilov@gmail.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Alexander Gavrilov committed
Oct 8, 2008 at 11:05 UTC
2df6442f7dc0d6cd5636e6ac413d06f92eb04029
1 file changed
+4
-2
gitk
+4
-2
@@ -6418,7 +6418,7 @@ proc getblobline {bf id} {
6418
6419
proc mergediff {id} {
6420
global diffmergeid mdifffd
6421
- global diffids
6421
+ global diffids treediffs
6422
global parents
6423
global diffcontext
6424
global diffencoding
@@ -6426,6 +6426,7 @@ proc mergediff {id} {
6426
6427
set diffmergeid $id
6428
set diffids $id
6429
+ set treediffs($id) {}
6430
# this doesn't seem to actually affect anything...
6431
set cmd [concat | git diff-tree --no-commit-id --cc -U$diffcontext $id]
6432
if {$limitdiffs && $vfilelimit($curview) ne {}} {
@@ -6445,7 +6446,7 @@ proc mergediff {id} {
6446
6447
proc getmergediffline {mdf id np} {
6448
global diffmergeid ctext cflist mergemax
6448
- global difffilestart mdifffd
6449
+ global difffilestart mdifffd treediffs
6450
global diffencoding
6451
6452
$ctext conf -state normal
@@ -6462,6 +6463,7 @@ proc getmergediffline {mdf id np} {
6463
$ctext insert end "\n"
6464
set here [$ctext index "end - 1c"]
6465
lappend difffilestart $here
6466
+ lappend treediffs($id) $fname
6467
add_flist [list $fname]
6468
set diffencoding [get_path_encoding $fname]
6469
set l [expr {(78 - [string length $fname]) / 2}]