git-am: print fair error message when format detection fails
authorNicolas Sebrecht <ni.s@laposte.net>
Fri, 7 Aug 2009 01:08:13 +0000 (20:08 -0500)
committerJunio C Hamano <gitster@pobox.com>
Fri, 7 Aug 2009 03:52:09 +0000 (20:52 -0700)
Avoid git ending with this message:
"Patch format is not supported."

With improved error message in the format detection failure case by
Giuseppe Bilotta.

Signed-off-by: Nicolas Sebrecht <ni.s@laposte.net>
Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-am.sh
index dd60f5d9cb6e8713551a5d3e93c40f9a0097a839..f719f6e654fdb7ee92013c824af439b5f0f58f95 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -268,7 +268,11 @@ split_patches () {
                msgnum=
                ;;
        *)
-               clean_abort "Patch format $patch_format is not supported."
+               if test -n "$parse_patch" ; then
+                       clean_abort "Patch format $patch_format is not supported."
+               else
+                       clean_abort "Patch format detection failed."
+               fi
                ;;
        esac
 }