Skip to content

Commit

Permalink
gitk: Fix context menu items for generating diffs when in tree mode
Browse files Browse the repository at this point in the history
Currently, if you invoke the "diff this -> selected" or "diff selected
-> this" and gitk is in "Tree" mode rather than "Patch" mode, the
diff display pane will just show the header but not the actual diff,
unless gitk has done the diff before and thus has the list of files
that differ.  This was because the logic in gettreediffline that
checked whether we had moved on to doing something else checked the
mode (Tree or Patch) before checking whether the ids we're diffing
had changed.

This fixes it.  The new logic in gettreediffline is slightly hacky
and relies on the fact that the Tree/Patch mode only applies when
we're looking at a single commit, not at the diff between two commits.

Signed-off-by: Paul Mackerras <[email protected]>
  • Loading branch information
paulusmack committed Nov 18, 2008
1 parent 68149a7 commit e116013
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gitk
Original file line number Diff line number Diff line change
Expand Up @@ -7129,7 +7129,7 @@ proc gettreediffline {gdtf ids} {
set treediffs($ids) $treediff
}
unset treepending
if {$cmitmode eq "tree"} {
if {$cmitmode eq "tree" && [llength $diffids] == 1} {
gettree $diffids
} elseif {$ids != $diffids} {
if {![info exists diffmergeid]} {
Expand Down

0 comments on commit e116013

Please sign in to comment.