X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=git-rebase--interactive.sh;h=5934b97fa106d73b1b091f050272c4c9f25eb646;hb=HEAD;hp=c2383bfed58f0d28d35b0a657a02b273d06d8b27;hpb=cbcf0a6981687b31635d806f45e77188c54b7cfc;p=git.git diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index c2383bfed..5934b97fa 100755 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -153,14 +153,6 @@ run_pre_rebase_hook () { fi } -require_clean_work_tree () { - # test if working tree is dirty - git rev-parse --verify HEAD > /dev/null && - git update-index --ignore-submodules --refresh && - git diff-files --quiet --ignore-submodules && - git diff-index --cached --quiet HEAD --ignore-submodules -- || - die "Working tree is dirty" -} ORIG_REFLOG_ACTION="$GIT_REFLOG_ACTION" @@ -557,7 +549,7 @@ do_next () { exit "$status" fi # Run in subshell because require_clean_work_tree can die. - if ! (require_clean_work_tree) + if ! (require_clean_work_tree "rebase") then warn "Commit or stash your changes, and then run" warn @@ -798,7 +790,7 @@ first and then run 'git rebase --continue' again." record_in_rewritten "$(cat "$DOTEST"/stopped-sha)" - require_clean_work_tree + require_clean_work_tree "rebase" do_rest ;; --abort) @@ -896,7 +888,7 @@ first and then run 'git rebase --continue' again." comment_for_reflog start - require_clean_work_tree + require_clean_work_tree "rebase" "Please commit or stash them." if test ! -z "$1" then