diff options
author | Junio C Hamano <junkio@cox.net> | 2007-05-20 23:51:06 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-05-20 23:51:06 -0700 |
commit | 077e1af5983000266bc7c1423a87b7768ca03754 (patch) | |
tree | 972c5b8f9823cad61171fdd378ff23690de31faa /git-am.sh | |
parent | Teach 'git-apply --whitespace=strip' to remove empty lines at the end of file (diff) | |
download | tgif-077e1af5983000266bc7c1423a87b7768ca03754.tar.xz |
git-apply: Fix removal of new trailing blank lines.
The earlier code removed one newline too many from the hunk that
adds new lines at the end of the file. Also the way the code
counted the added blank lines was somewhat roundabout; I think
the way updated code does it is more direct and easier to
follow:
* We keep track of the number of blank lines added;
* While processing each line, we notice if it adds a blank
line, and increment the counter, or reset it to zero
otherwise;
* When actually we apply the data, we remove the empty lines we
counted earlier if we are applying it at the end of the
file.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-am.sh')
0 files changed, 0 insertions, 0 deletions