am: teach mercurial patch parser how to read from stdin
[gitweb.git] / git-am.sh
index 5eec11d5f09c50a83553a8ea5ad763f0d2e44feb..f35710cb502543f35b642fd8a49f0d2cc8beba62 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -327,6 +327,7 @@ split_patches () {
                ;;
        hg)
                this=0
+               test 0 -eq "$#" && set -- -
                for hg in "$@"
                do
                        this=$(( $this + 1 ))
@@ -353,7 +354,7 @@ split_patches () {
                                        print "\n", $_ ;
                                        $subject = 1;
                                }
-                       ' <"$hg" >"$dotest/$msgnum" || clean_abort
+                       ' -- "$hg" >"$dotest/$msgnum" || clean_abort
                done
                echo "$this" >"$dotest/last"
                this=