Skip to content

Commit

Permalink
gitk: Handle blobs containing a DOS end-of-file marker
Browse files Browse the repository at this point in the history
If a patchset contains an EOF marker (Ctrl-Z) the blob diff terminates
at that point.  This permits gitk to ignore the eof and continue to
display any subsequent blobs and also displays a sensible representation
of the eof char.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Pat Thoyts authored and Paul Mackerras committed Mar 23, 2009
1 parent 52b8ea9 commit 681c329
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gitk
Original file line number Diff line number Diff line change
Expand Up @@ -7216,7 +7216,7 @@ proc getblobdiffs {ids} {
set diffnparents 0
set diffinhdr 0
set diffencoding [get_path_encoding {}]
fconfigure $bdf -blocking 0 -encoding binary
fconfigure $bdf -blocking 0 -encoding binary -eofchar {}
set blobdifffd($ids) $bdf
filerun $bdf [list getblobdiffline $bdf $diffids]
}
Expand Down Expand Up @@ -7367,7 +7367,8 @@ proc getblobdiffline {bdf ids} {
$ctext insert end "$line\n" filesep

} else {
set line [encoding convertfrom $diffencoding $line]
set line [string map {\x1A ^Z} \
[encoding convertfrom $diffencoding $line]]
# parse the prefix - one ' ', '-' or '+' for each parent
set prefix [string range $line 0 [expr {$diffnparents - 1}]]
set tag [expr {$diffnparents > 1? "m": "d"}]
Expand Down

0 comments on commit 681c329

Please sign in to comment.