aboutsummaryrefslogtreecommitdiff
path: root/git-rebase--interactive.sh
diff options
context:
space:
mode:
authorLiam Beguin <liambeguin@gmail.com>2017-12-05 12:52:33 -0500
committerJunio C Hamano <gitster@pobox.com>2017-12-05 10:20:51 -0800
commit0cce4a2756eb2c66544615e5ccd74671afb33256 (patch)
tree5165b7868b62a88b7f26a58efe90993c2520f9c1 /git-rebase--interactive.sh
parent313a48eaca58ecd170bef9e6a5a55001c7511f08 (diff)
downloadgit-0cce4a2756eb2c66544615e5ccd74671afb33256.tar.gz
git-0cce4a2756eb2c66544615e5ccd74671afb33256.tar.xz
rebase -i -x: add exec commands via the rebase--helper
Recent work on `git-rebase--interactive` aims to convert shell code to C. Even if this is most likely not a big performance enhancement, let's convert it too since a coming change to abbreviate command names requires it to be updated. Signed-off-by: Liam Beguin <liambeguin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-rebase--interactive.sh')
-rw-r--r--git-rebase--interactive.sh23
1 files changed, 1 insertions, 22 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 437815669..e3f5a0abf 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -722,27 +722,6 @@ collapse_todo_ids() {
git rebase--helper --shorten-ids
}
-# Add commands after a pick or after a squash/fixup series
-# in the todo list.
-add_exec_commands () {
- {
- first=t
- while read -r insn rest
- do
- case $insn in
- pick)
- test -n "$first" ||
- printf "%s" "$cmd"
- ;;
- esac
- printf "%s %s\n" "$insn" "$rest"
- first=
- done
- printf "%s" "$cmd"
- } <"$1" >"$1.new" &&
- mv "$1.new" "$1"
-}
-
# Switch to the branch in $into and notify it in the reflog
checkout_onto () {
GIT_REFLOG_ACTION="$GIT_REFLOG_ACTION: checkout $onto_name"
@@ -982,7 +961,7 @@ fi
test -s "$todo" || echo noop >> "$todo"
test -z "$autosquash" || git rebase--helper --rearrange-squash || exit
-test -n "$cmd" && add_exec_commands "$todo"
+test -n "$cmd" && git rebase--helper --add-exec-commands "$cmd"
todocount=$(git stripspace --strip-comments <"$todo" | wc -l)
todocount=${todocount##* }