X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-am.sh;h=d3390755fc687a611e89320a7bbfb4ead512c863;hb=c511549e0c6848f00bd19f152b8ab42261ff5d0c;hp=8bcb206022ae5d4ae82d2a37d8f79454c043ad78;hpb=7de265a4cfd2c6dbe1c7af8c592a23ede08ec854;p=git.git diff --git a/git-am.sh b/git-am.sh index 8bcb20602..d3390755f 100755 --- a/git-am.sh +++ b/git-am.sh @@ -221,6 +221,9 @@ then resume=yes case "$skip,$abort" in + t,t) + die "Please make up your mind. --skip or --abort?" + ;; t,) git rerere clear git read-tree --reset -u HEAD HEAD @@ -229,12 +232,19 @@ then git update-ref ORIG_HEAD $orig_head ;; ,t) + if test -f "$dotest/rebasing" + then + exec git rebase --abort + fi git rerere clear - git read-tree --reset -u HEAD ORIG_HEAD - git reset ORIG_HEAD + test -f "$dotest/dirtyindex" || { + git read-tree --reset -u HEAD ORIG_HEAD + git reset ORIG_HEAD + } rm -fr "$dotest" exit ;; esac + rm -f "$dotest/dirtyindex" else # Make sure we are not given --skip, --resolved, nor --abort test "$skip$resolved$abort" = "" || @@ -287,7 +297,11 @@ fi case "$resolved" in '') files=$(git diff-index --cached --name-only HEAD --) || exit - test "$files" && die "Dirty index: cannot apply patches (dirty: $files)" + if test "$files" + then + : >"$dotest/dirtyindex" + die "Dirty index: cannot apply patches (dirty: $files)" + fi esac if test "$(cat "$dotest/utf8")" = t