git-am support for naked email messages (take 2)
[git.git] / git-am.sh
index 8f073c9..f143b7e 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 ;;