summaryrefslogtreecommitdiff
path: root/git-rebase--interactive.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-06-25 11:02:09 -0700
committerJunio C Hamano <gitster@pobox.com>2015-06-25 11:02:09 -0700
commitf249409b6be74132e80e6d83f264aaa158563be1 (patch)
tree54dc338a17ec14a4f79fdbf72947253eca1ee7cd /git-rebase--interactive.sh
parentf09bd215cde5e30029fe08f309d0554eb9256778 (diff)
parent141ff8f9e7a235ab279329ba348e3d88fca4fdab (diff)
downloadgit-f249409b6be74132e80e6d83f264aaa158563be1.tar.gz
Merge branch 'mm/rebase-i-post-rewrite-exec' into maint
"git rebase -i" fired post-rewrite hook when it shouldn't (namely, when it was told to stop sequencing with 'exec' insn). * mm/rebase-i-post-rewrite-exec: t5407: use <<- to align the expected output rebase -i: fix post-rewrite hook with failed exec command rebase -i: demonstrate incorrect behavior of post-rewrite
Diffstat (limited to 'git-rebase--interactive.sh')
-rw-r--r--git-rebase--interactive.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 0008057252..8c5de4c1eb 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -502,7 +502,7 @@ do_pick () {
}
do_next () {
- rm -f "$msg" "$author_script" "$amend" || exit
+ rm -f "$msg" "$author_script" "$amend" "$state_dir"/stopped-sha || exit
read -r command sha1 rest < "$todo"
case "$command" in
"$comment_char"*|''|noop)
@@ -592,9 +592,6 @@ do_next () {
read -r command rest < "$todo"
mark_action_done
printf 'Executing: %s\n' "$rest"
- # "exec" command doesn't take a sha1 in the todo-list.
- # => can't just use $sha1 here.
- git rev-parse --verify HEAD > "$state_dir"/stopped-sha
${SHELL:-@SHELL_PATH@} -c "$rest" # Actual execution
status=$?
# Run in subshell because require_clean_work_tree can die.
@@ -890,7 +887,10 @@ first and then run 'git rebase --continue' again."
fi
fi
- record_in_rewritten "$(cat "$state_dir"/stopped-sha)"
+ if test -r "$state_dir"/stopped-sha
+ then
+ record_in_rewritten "$(cat "$state_dir"/stopped-sha)"
+ fi
require_clean_work_tree "rebase"
do_rest