summaryrefslogtreecommitdiff
path: root/t/t3429-rebase-edit-todo.sh
diff options
context:
space:
mode:
authorStephen Hicks <sdh@google.com>2017-04-26 19:17:40 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-04-27 01:56:26 (GMT)
commit54fd3243daec7d59394f25846450d83c0012e57c (patch)
treef5dac03405fbe120d5a1fcad876fe8fd60a00a6e /t/t3429-rebase-edit-todo.sh
parente2cb6ab84c94f147f1259260961513b40c36108a (diff)
downloadgit-54fd3243daec7d59394f25846450d83c0012e57c.zip
git-54fd3243daec7d59394f25846450d83c0012e57c.tar.gz
git-54fd3243daec7d59394f25846450d83c0012e57c.tar.bz2
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 <sdh@google.com> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3429-rebase-edit-todo.sh')
-rwxr-xr-xt/t3429-rebase-edit-todo.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t3429-rebase-edit-todo.sh b/t/t3429-rebase-edit-todo.sh
new file mode 100755
index 0000000..b9292df
--- /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