Code

git-gui: Correctly ignore '* Unmerged path' during diff.
authorShawn O. Pearce <spearce@spearce.org>
Sun, 21 Jan 2007 19:23:51 +0000 (14:23 -0500)
committerShawn O. Pearce <spearce@spearce.org>
Mon, 22 Jan 2007 03:47:56 +0000 (22:47 -0500)
If a path is really unmerged, such as because it has been deleted and
also modifed, we cannot obtain a diff for it.  Instead Git is sending
back '* Unmerged path <blah>' for file <blah>.  We should display this
line as-is as our tag selecting switches don't recognize it.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui.sh

index d26868beca6a290bfe033d4b2318769d03e3d328..8e664f54e8a462aaea4490c33d761fb933c15649 100755 (executable)
@@ -708,7 +708,8 @@ proc read_diff {fd} {
                #
                if {[string match {@@@ *} $line]} {set is_3way_diff 1}
 
-               if {[string match {index *} $line]} {
+               if {[string match {index *} $line]
+                       || [regexp {^\* Unmerged path } $line]} {
                        set tags {}
                } elseif {$is_3way_diff} {
                        set op [string range $line 0 1]