fi
}
-complete_action() {
- test -s "$todo" || echo noop >> "$todo"
- test -z "$autosquash" || git rebase--helper --rearrange-squash || exit
- test -n "$cmd" && git rebase--helper --add-exec-commands "$cmd"
-
- todocount=$(git stripspace --strip-comments <"$todo" | wc -l)
- todocount=${todocount##* }
-
-cat >>"$todo" <<EOF
-
-$comment_char $(eval_ngettext \
- "Rebase \$shortrevisions onto \$shortonto (\$todocount command)" \
- "Rebase \$shortrevisions onto \$shortonto (\$todocount commands)" \
- "$todocount")
-EOF
- git rebase--helper --append-todo-help ${keep_empty:+--keep-empty}
-
- has_action "$todo" ||
- return 2
-
- cp "$todo" "$todo".backup
- collapse_todo_ids
- git_sequence_editor "$todo" ||
- die_abort "$(gettext "Could not execute editor")"
-
- has_action "$todo" ||
- return 2
-
- git rebase--helper --check-todo-list || {
- ret=$?
- git rebase--helper --checkout-onto "$onto_name" "$onto" \
- "$orig_head" ${verbose:+--verbose}
- exit $ret
- }
-
- expand_todo_ids
-
- test -n "$force_rebase" ||
- onto="$(git rebase--helper --skip-unnecessary-picks)" ||
- die "Could not skip unnecessary pick commands"
-
- git rebase--helper --checkout-onto "$onto_name" "$onto" "$orig_head" \
- ${verbose:+--verbose}
- require_clean_work_tree "rebase"
- exec git rebase--helper ${force_rebase:+--no-ff} $allow_empty_message \
- --continue
-}
-
git_rebase__interactive () {
initiate_action "$action"
ret=$?
$revisions ${restrict_revision+^$restrict_revision} >"$todo" ||
die "$(gettext "Could not generate todo list")"
- complete_action
+ exec git rebase--helper --complete-action "$shortrevisions" "$onto_name" \
+ "$shortonto" "$orig_head" "$cmd" $allow_empty_message \
+ ${autosquash:+--autosquash} ${keep_empty:+--keep-empty} \
+ ${verbose:+--verbose} ${force_rebase:+--no-ff}
}