git-am support for naked email messages (take 2)
[gitweb.git] / git-am.sh
index 8f073c90f6dce20e6e4f3a0b3046cc25dfd503e0..f143b7e782ce3b7cc7043c2d00e6cdcc10741bfe 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -1,7 +1,7 @@
 #!/bin/sh
 #
 #
-. git-sh-setup || die "Not a git archive"
+. git-sh-setup
 
 usage () {
     echo >&2 "usage: $0 [--signoff] [--dotest=<dir>] [--utf8] [--binary] [--3way] <mbox>"
@@ -164,10 +164,7 @@ else
        # Start afresh.
        mkdir -p "$dotest" || exit
 
-       # cat does the right thing for us, including '-' to mean
-       # standard input.
-       cat "$@" |
-       git-mailsplit -d$prec "$dotest/" >"$dotest/last" || {
+       git-mailsplit -d"$prec" -o"$dotest" -b -- "$@" > "$dotest/last" ||  {
                rm -fr "$dotest"
                exit 1
        }
@@ -312,7 +309,7 @@ do
                echo "--------------------------"
                cat "$dotest/final-commit"
                echo "--------------------------"
-               echo -n "Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all "
+               printf "Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all "
                read reply
                case "$reply" in
                [yY]*) action=yes ;;