]> asedeno.scripts.mit.edu Git - git.git/blobdiff - git-am.sh
git-help: add -w|--web option to display html man page in a browser.
[git.git] / git-am.sh
index 4126f0e857bad273d6f44cabe34565de860bd119..2e407084260350e7fa56987a7603afdcd00acfb5 100755 (executable)
--- a/git-am.sh
+++ b/git-am.sh
@@ -218,7 +218,7 @@ fi
 
 case "$resolved" in
 '')
-       files=$(git diff-index --cached --name-only HEAD) || exit
+       files=$(git diff-index --cached --name-only HEAD --) || exit
        if [ "$files" ]; then
           echo "Dirty index: cannot apply patches (dirty: $files)" >&2
           exit 1
@@ -307,9 +307,9 @@ do
        GIT_AUTHOR_EMAIL="$(sed -n '/^Email/ s/Email: //p' "$dotest/info")"
        GIT_AUTHOR_DATE="$(sed -n '/^Date/ s/Date: //p' "$dotest/info")"
 
-       if test -z "$GIT_AUTHOR_EMAIL"
+       if test -z "$GIT_AUTHOR_EMAIL" || test -z "$GIT_AUTHOR_DATE"
        then
-               echo "Patch does not have a valid e-mail address."
+               echo "Patch does not have valid authorship information."
                stop_here $this
        fi
 
@@ -352,7 +352,7 @@ do
                case "$resolved$interactive" in
                tt)
                        # This is used only for interactive view option.
-                       git diff-index -p --cached HEAD >"$dotest/patch"
+                       git diff-index -p --cached HEAD -- >"$dotest/patch"
                        ;;
                esac
        esac
@@ -411,7 +411,7 @@ do
                # trust what the user has in the index file and the
                # working tree.
                resolved=
-               git diff-index --quiet --cached HEAD && {
+               git diff-index --quiet --cached HEAD -- && {
                        echo "No changes - did you forget to use 'git add'?"
                        stop_here_user_resolve $this
                }
@@ -433,7 +433,7 @@ do
                then
                    # Applying the patch to an earlier tree and merging the
                    # result may have produced the same tree as ours.
-                   git diff-index --quiet --cached HEAD && {
+                   git diff-index --quiet --cached HEAD -- && {
                        echo No changes -- Patch already applied.
                        go_next
                        continue