From 54fd3243daec7d59394f25846450d83c0012e57c Mon Sep 17 00:00:00 2001 From: Stephen Hicks Date: Wed, 26 Apr 2017 21:17:40 +0200 Subject: rebase -i: reread the todo list if `exec` touched it In the scripted version of the interactive rebase, there was no internal representation of the todo list; it was re-read before every command. That allowed the hack that an `exec` command could append (or even completely rewrite) the todo list. This hack was broken by the partial conversion of the interactive rebase to C, and this patch reinstates it. We also add a small test to verify that this fix does not regress in the future. Signed-off-by: Stephen Hicks Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- t/t3429-rebase-edit-todo.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 t/t3429-rebase-edit-todo.sh (limited to 't') diff --git a/t/t3429-rebase-edit-todo.sh b/t/t3429-rebase-edit-todo.sh new file mode 100755 index 0000000000..b9292dfc2a --- /dev/null +++ b/t/t3429-rebase-edit-todo.sh @@ -0,0 +1,14 @@ +#!/bin/sh + +test_description='rebase should reread the todo file if an exec modifies it' + +. ./test-lib.sh + +test_expect_success 'rebase exec modifies rebase-todo' ' + test_commit initial && + todo=.git/rebase-merge/git-rebase-todo && + git rebase HEAD -x "echo exec touch F >>$todo" && + test -e F +' + +test_done -- cgit v1.2.3