In check_patch_format we feed $1 to a block that attempts to determine the patch format. Since we've already redirected $1 to stdin there is no need to redirect it again when we invoke tr. This prevents the following errors when invoking git am $ git am patch.patch tr: write error: Broken pipe tr: write error Patch format detection failed. Cc: Stephen Boyd <bebarino@xxxxxxxxx> Signed-off-by: Chris Packham <judge.packham@xxxxxxxxx> --- git-am.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-am.sh b/git-am.sh index f979925..5d69c89 100755 --- a/git-am.sh +++ b/git-am.sh @@ -253,7 +253,7 @@ check_patch_format () { # discarding the indented remainder of folded lines, # and see if it looks like that they all begin with the # header field names... - tr -d '\015' <"$1" | + tr -d '\015' | sed -n -e '/^$/q' -e '/^[ ]/d' -e p | sane_egrep -v '^[!-9;-~]+:' >/dev/null || patch_format=mbox -- 2.0.4.2.gadd452d -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html