[PATCH] git-am: ignore leading whitespace before patch
- From
David Barr <davidbarr@google.com>
- Date
- Aug 2, 2011, 22:20 UTC
- Message-ID
- <1312323646-93427-1-git-send-email-davidbarr@google.com>
Some web-based email clients prepend whitespace to raw message transcripts to workaround content-sniffing in some browsers. Adjust the patch format detection logic to ignore leading whitespace.
Signed-off-by: David Barr <davidbarr@google.com> --- git-am.sh | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/git-am.sh b/git-am.sh index 463c741..19b2f0f 100755 --- a/git-am.sh +++ b/git-am.sh @@ -199,7 +199,11 @@ check_patch_format () { # otherwise, check the first few lines of the first patch to try # to detect its format { - read l1 + # Start from first line containing non-whitespace + until [ -n "$l1" ] + do + read l1 + done read l2 read l3 case "$l1" in
-- 1.7.6