Code

Merge branch 'do/rebase-i-arbitrary'
[git.git] / t / t3404-rebase-interactive.sh
index 05708c2462b1b2d90113553065bbbe3dad53cc9c..b0b43c6d329cacf24fd9ea6d69320e13d34b154c 100755 (executable)
@@ -553,6 +553,30 @@ test_expect_success 'reword' '
        git show HEAD~2 | grep "C changed"
 '
 
+test_expect_success 'rebase -i can copy notes' '
+       git config notes.rewrite.rebase true &&
+       git config notes.rewriteRef "refs/notes/*" &&
+       test_commit n1 &&
+       test_commit n2 &&
+       test_commit n3 &&
+       git notes add -m"a note" n3 &&
+       git rebase --onto n1 n2 &&
+       test "a note" = "$(git notes show HEAD)"
+'
+
+cat >expect <<EOF
+an earlier note
+a note
+EOF
+
+test_expect_success 'rebase -i can copy notes over a fixup' '
+       git reset --hard n3 &&
+       git notes add -m"an earlier note" n2 &&
+       GIT_NOTES_REWRITE_MODE=concatenate FAKE_LINES="1 fixup 2" git rebase -i n1 &&
+       git notes show > output &&
+       test_cmp expect output
+'
+
 test_expect_success 'rebase while detaching HEAD' '
        git symbolic-ref HEAD &&
        grandparent=$(git rev-parse HEAD~2) &&