]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t3429-rebase-edit-todo.sh
l10n: it.po: update the Italian translation for Git 2.24.0 round #2
[thirdparty/git.git] / t / t3429-rebase-edit-todo.sh
index 76f6d306eaf39e9727bfeb3dbb04aa3c3941cf1d..8739cb60a77a61f6a6a2e08ebb4ae64c92bafb67 100755 (executable)
@@ -3,9 +3,15 @@
 test_description='rebase should reread the todo file if an exec modifies it'
 
 . ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-rebase.sh
+
+test_expect_success 'setup' '
+       test_commit first file &&
+       test_commit second file &&
+       test_commit third file
+'
 
 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
@@ -33,4 +39,17 @@ test_expect_success SHA1 'loose object cache vs re-reading todo list' '
        git rebase HEAD -x "./append-todo.sh 5 6"
 '
 
+test_expect_success 'todo is re-read after reword and squash' '
+       write_script reword-editor.sh <<-\EOS &&
+       GIT_SEQUENCE_EDITOR="echo \"exec echo $(cat file) >>actual\" >>" \
+               git rebase --edit-todo
+       EOS
+
+       test_write_lines first third >expected &&
+       set_fake_editor &&
+       GIT_SEQUENCE_EDITOR="$EDITOR" FAKE_LINES="reword 1 squash 2 fixup 3" \
+               GIT_EDITOR=./reword-editor.sh git rebase -i --root third &&
+       test_cmp expected actual
+'
+
 test_done