X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=git-am.sh;h=7cc4ae5a30ed3a56cff9def63e351f957cad6666;hb=c401cb48e77459a4ccad76888ad31bef252facc5;hp=85ecada657d21aba4b54034dbaf869f8387d7d02;hpb=6ead3972f54e290b255b9c5379a2f9a35ec9f847;p=git.git diff --git a/git-am.sh b/git-am.sh index 85ecada6..7cc4ae5a 100755 --- a/git-am.sh +++ b/git-am.sh @@ -300,7 +300,7 @@ do } >"$dotest/final-commit" ;; *) - case "$resolved,$interactive" in + case "$resolved$interactive" in tt) # This is used only for interactive view option. git-diff-index -p --cached HEAD >"$dotest/patch" @@ -364,6 +364,12 @@ do # trust what the user has in the index file and the # working tree. resolved= + changed="$(git-diff-index --cached --name-only HEAD)" + if test '' = "$changed" + then + echo "No changes - did you forget update-index?" + stop_here $this + fi apply_status=0 ;; esac @@ -374,7 +380,7 @@ do then # Applying the patch to an earlier tree and merging the # result may have produced the same tree as ours. - changed="$(git-diff-index --cached --name-only -z HEAD)" + changed="$(git-diff-index --cached --name-only HEAD)" if test '' = "$changed" then echo No changes -- Patch already applied.