diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-06-16 20:06:55 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-06-16 20:06:55 -0700 |
commit | fb7dfaa710da6f9ebb854f70ffc1c78668a1e70c (patch) | |
tree | e09f2a46099de99a00e1a256b5dfad02927c7ad9 /git-gui/lib/diff.tcl | |
parent | 0dbd81251dbc516bb3bf07862c369fc582a4e5e0 (diff) | |
parent | 8a383db4b28059becc3ebfd1b402299e34c3151f (diff) | |
download | git-fb7dfaa710da6f9ebb854f70ffc1c78668a1e70c.tar.gz |
Merge tag 'gitgui-0.18.0' of git://repo.or.cz/git-gui
git-gui 0.18.0
* tag 'gitgui-0.18.0' of git://repo.or.cz/git-gui:
git-gui 0.18
git-gui: avoid an error message when removing the last remote
git-gui: fix file name handling with non-empty prefix
git-gui: bring wish process to front on Mac
git-gui: change dialog button positions for Windows to suit platform.
git-gui: allow "\ No newline at end of file" for linewise staging
git-gui: fix the mergetool launcher for the Beyond Compare tool.
Makefile: replace "echo 1>..." with "echo >..."
French translation: copy -> copie.
git-gui: Fix parsing of <rev> <path-which-not-present-in-worktree>
Diffstat (limited to 'git-gui/lib/diff.tcl')
-rw-r--r-- | git-gui/lib/diff.tcl | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/git-gui/lib/diff.tcl b/git-gui/lib/diff.tcl index ec4405567a..30d9a79776 100644 --- a/git-gui/lib/diff.tcl +++ b/git-gui/lib/diff.tcl @@ -764,8 +764,15 @@ proc apply_range_or_line {x y} { # context line set ln [$ui_diff get $i_l $next_l] set patch "$patch$pre_context$ln" - set n [expr $n+1] - set m [expr $m+1] + # Skip the "\ No newline at end of + # file". Depending on the locale setting + # we don't know what this line looks + # like exactly. The only thing we do + # know is that it starts with "\ " + if {![string match {\\ *} $ln]} { + set n [expr $n+1] + set m [expr $m+1] + } set pre_context {} } elseif {$c1 eq $to_context} { # turn change line into context line |