]> asedeno.scripts.mit.edu Git - git.git/blobdiff - git-am.sh
git-am: suggest what to do with superfluous patches
[git.git] / git-am.sh
index 1056075545ad3e5e42626d167c91c1deada6186b..43ea52c15c3031bd12e86df4016fb35efaf05e5d 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -726,6 +726,8 @@ do
                resolved=
                git diff-index --quiet --cached HEAD -- && {
                        echo "No changes - did you forget to use 'git add'?"
+                       echo "If there is nothing left to stage, chances are that something else"
+                       echo "already introduced the same changes; you might want to skip this patch."
                        stop_here_user_resolve $this
                }
                unmerged=$(git ls-files -u)
@@ -740,7 +742,7 @@ do
                ;;
        esac
 
-       if test $apply_status = 1 && test "$threeway" = t
+       if test $apply_status != 0 && test "$threeway" = t
        then
                if (fall_back_3way)
                then