Code

gitk: Fix diffing committed -> staged (typo in diffcmd)
authorJens Lehmann <Jens.Lehmann@web.de>
Tue, 27 Oct 2009 17:13:42 +0000 (18:13 +0100)
committerPaul Mackerras <paulus@samba.org>
Tue, 3 Nov 2009 11:28:34 +0000 (22:28 +1100)
When highlighting a commit, using the context menu over the staged changes
and then selecting "Diff this -> selected" the diff was empty.  The same
happened when highlighting the staged changes and using "Diff selected ->
this" over a commit.  The reason was a copy/paste error in [diffcmd].
This fixes it.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk

diff --git a/gitk b/gitk
index d40a7354892b77d5de24eaf118518f2ecb7cb942..785afd2235273af930f44c08d7b528f5ff3655f1 100755 (executable)
--- a/gitk
+++ b/gitk
@@ -7225,7 +7225,7 @@ proc diffcmd {ids flags} {
        set cmd [concat | git diff-index --cached $flags]
        if {[llength $ids] > 1} {
            # comparing index with specific revision
-           if {$i == 0} {
+           if {$j == 0} {
                lappend cmd -R [lindex $ids 1]
            } else {
                lappend cmd [lindex $ids 0]