gitk: Fix context menu items for generating diffs when in tree mode
commite11601381e384898418c30bd537a9daa1210c300
authorPaul Mackerras <paulus@samba.org>
Tue, 18 Nov 2008 10:40:32 +0000 (18 21:40 +1100)
committerPaul Mackerras <paulus@samba.org>
Tue, 18 Nov 2008 10:40:32 +0000 (18 21:40 +1100)
tree95163aa1c4b5f0293f6ca88e2fa8fc6d2b046621
parent68149a71978564aaef7a5fe956cf1de2864c16d3
gitk: Fix context menu items for generating diffs when in tree mode

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 <paulus@samba.org>
gitk