@matheusbsbs / matheus-bagliano / commits / 6900d750f4
Fork 0

git-am: fixed patch_format detection according to RFC2822

RFC2822 specifies in paragraph 3.6.8, that optional header fields are made up of any printable US-ASCII character except ' ' (space) and ':' (colon). The pattern for the egrep command is changed to match all of these characters. Signed-off-by: Christian Himpel <chressie@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Christian Himpel committed Sep 25, 2009 at 17:14 UTC 6900d750f4894e7bee714874c04cc14312cd91ec
1 file changed +1 -1
git-am.sh
+1 -1
@@ -205,7 +205,7 @@ check_patch_format () {
205 # and see if it looks like that they all begin with the
206 # header field names...
207 sed -n -e '/^$/q' -e '/^[ ]/d' -e p "$1" |
208 - egrep -v '^[A-Za-z]+(-[A-Za-z]+)*:' >/dev/null ||
208 + egrep -v '^[!-9;-~]+:' >/dev/null ||
209 patch_format=mbox
210 fi
211 } < "$1" || clean_abort