From: Junio C Hamano Date: Fri, 19 Aug 2011 05:07:57 +0000 (-0700) Subject: Merge branch 'db/am-skip-blank-at-the-beginning' X-Git-Tag: v1.7.7-rc0~19 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/beace29a0437068a36bc5963d905fac482724196?ds=inline;hp=-c Merge branch 'db/am-skip-blank-at-the-beginning' * db/am-skip-blank-at-the-beginning: am: ignore leading whitespace before patch --- beace29a0437068a36bc5963d905fac482724196 diff --combined git-am.sh index 57150eb7ba,c8422dbe6e..b2c4b2b853 --- a/git-am.sh +++ b/git-am.sh @@@ -22,7 -22,6 +22,7 @@@ whitespace= pass it through git-app ignore-space-change pass it through git-apply ignore-whitespace pass it through git-apply directory= pass it through git-apply +exclude= pass it through git-apply C= pass it through git-apply p= pass it through git-apply patch-format= format the patch(es) are in @@@ -197,10 -196,15 +197,15 @@@ check_patch_format () return 0 fi - # otherwise, check the first few lines of the first patch to try - # to detect its format + # otherwise, check the first few non-blank lines of the first + # patch to try to detect its format { - read l1 + # Start from first line containing non-whitespace + l1= + while test -z "$l1" + do + read l1 + done read l2 read l3 case "$l1" in @@@ -367,7 -371,7 +372,7 @@@ d ;; --resolvemsg) shift; resolvemsg=$1 ;; - --whitespace|--directory) + --whitespace|--directory|--exclude) git_apply_opt="$git_apply_opt $(sq "$1=$2")"; shift ;; -C|-p) git_apply_opt="$git_apply_opt $(sq "$1$2")"; shift ;; @@@ -512,8 -516,6 +517,8 @@@ els fi fi +git update-index -q --refresh + case "$resolved" in '') case "$HAS_HEAD" in