aboutsummaryrefslogtreecommitdiff
path: root/git-am.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-08-04 22:31:59 -0500
committerJunio C Hamano <gitster@pobox.com>2009-08-05 12:14:00 -0700
commitc2ca1d79dbd54b06a05e5d14a897699e59dc9f9f (patch)
tree18b07e292194aeae75649206b4a5513f11676025 /git-am.sh
parent6a2d3f50f5a509fdfefca371c7178e36c0bcf7e9 (diff)
downloadgit-c2ca1d79dbd54b06a05e5d14a897699e59dc9f9f.tar.gz
git-c2ca1d79dbd54b06a05e5d14a897699e59dc9f9f.tar.xz
Allow mailsplit (and hence git-am) to handle mails with CRLF line-endings
It is not that uncommon to have mails with DOS line-ending, notably Thunderbird and web mailers like Gmail (when saving what they call "original" message). So modify mailsplit to convert CRLF line-endings to just LF. Since git-rebase is built on top of git-am, add an option to mailsplit to be used by git-am when it is acting on behalf of git-rebase, to refrain from doing this conversion. And add a test to make sure that rebase still works. Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-am.sh')
-rwxr-xr-xgit-am.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/git-am.sh b/git-am.sh
index d64d99753..985226bfe 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -197,7 +197,13 @@ check_patch_format () {
split_patches () {
case "$patch_format" in
mbox)
- git mailsplit -d"$prec" -o"$dotest" -b -- "$@" > "$dotest/last" ||
+ case "$rebasing" in
+ '')
+ keep_cr= ;;
+ ?*)
+ keep_cr=--keep-cr ;;
+ esac
+ git mailsplit -d"$prec" -o"$dotest" -b $keep_cr -- "$@" > "$dotest/last" ||
clean_abort
;;
stgit-series)