gitk: Do not mistake unchanged lines for submodule changes
authorGabriele Mazzotta <gabriele.mzt@gmail.com>
Sat, 23 Mar 2019 17:00:36 +0000 (18:00 +0100)
committerPaul Mackerras <paulus@ozlabs.org>
Fri, 13 Sep 2019 23:35:43 +0000 (09:35 +1000)
Unchanged lines are prefixed with a white-space, thus unchanged lines
starting with either " <" or " >" are mistaken for submodule changes.
Check if a line starts with either " <" or " >" only if we are listing
the changes of a submodule.

Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
gitk
diff --git a/gitk b/gitk
index 5c6db3d6c470797da4dbff2cc2555ab3087b85bb..abe4805adedb3c3559bf0048ae49df2e2ac37337 100755 (executable)
--- a/gitk
+++ b/gitk
@@ -8228,11 +8228,11 @@ proc parseblobdiffline {ids line} {
        } else {
            $ctext insert end "$line\n" filesep
        }
-    } elseif {![string compare -length 3 "  >" $line]} {
+    } elseif {$currdiffsubmod != "" && ![string compare -length 3 "  >" $line]} {
        set $currdiffsubmod ""
        set line [encoding convertfrom $diffencoding $line]
        $ctext insert end "$line\n" dresult
-    } elseif {![string compare -length 3 "  <" $line]} {
+    } elseif {$currdiffsubmod != "" && ![string compare -length 3 "  <" $line]} {
        set $currdiffsubmod ""
        set line [encoding convertfrom $diffencoding $line]
        $ctext insert end "$line\n" d0