Skip to content

Commit

Permalink
gitk: Fix file list context menu for merge commits
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexander Gavrilov authored and Paul Mackerras committed Oct 21, 2008
1 parent bee866f commit 2df6442
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gitk
Original file line number Diff line number Diff line change
Expand Up @@ -6418,14 +6418,15 @@ proc getblobline {bf id} {

proc mergediff {id} {
global diffmergeid mdifffd
global diffids
global diffids treediffs
global parents
global diffcontext
global diffencoding
global limitdiffs vfilelimit curview

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

proc getmergediffline {mdf id np} {
global diffmergeid ctext cflist mergemax
global difffilestart mdifffd
global difffilestart mdifffd treediffs
global diffencoding

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

0 comments on commit 2df6442

Please sign in to comment.