diff --git a/tools/git-applymbox b/tools/git-applymbox index 889d4c1743ccdfcf8ad0be96a58eb8b60c03ccdc..afcb00a3f5e25d062eb1219994506a669e252bc5 100755 --- a/tools/git-applymbox +++ b/tools/git-applymbox @@ -18,6 +18,8 @@ ## use a Signoff_file, because applypatch wants to append the sign-off ## message to msg-clean every time it is run. +. git-sh-setup-script || die "Not a git archive" + keep_subject= query_apply= continue= resume=t while case "$#" in 0) break ;; esac do @@ -39,6 +41,12 @@ case "$continue" in shift esac +files=$(git-diff-cache --cached --name-only HEAD) || exit +if [ "$files" ]; then + echo "Dirty index: cannot apply patches (dirty: $files)" >&2 + exit 1 +fi + case "$query_apply" in t) touch .dotest/.query_apply esac