summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorThomas Rast <trast@student.ethz.ch>2010-03-12 17:04:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-03-13 05:55:40 (GMT)
commiteb2151bb8938a8e2af86e3ed34243af7b1c95786 (patch)
tree3662a91fb03bd6c76d6ff1caa3409eeacf72f18d /t
parent6956f858f6237d426fa422949033e3c558104802 (diff)
downloadgit-eb2151bb8938a8e2af86e3ed34243af7b1c95786.zip
git-eb2151bb8938a8e2af86e3ed34243af7b1c95786.tar.gz
git-eb2151bb8938a8e2af86e3ed34243af7b1c95786.tar.bz2
rebase: support automatic notes copying
Luckily, all the support already happens to be there. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t3400-rebase.sh17
-rwxr-xr-xt/t3404-rebase-interactive.sh24
2 files changed, 41 insertions, 0 deletions
diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
index 4e6a44b..cca2840 100755
--- a/t/t3400-rebase.sh
+++ b/t/t3400-rebase.sh
@@ -155,4 +155,21 @@ test_expect_success 'Rebase a commit that sprinkles CRs in' '
git diff --exit-code file-with-cr:CR HEAD:CR
'
+test_expect_success 'rebase 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)"
+'
+
+test_expect_success 'rebase -m can copy notes' '
+ git reset --hard n3 &&
+ git rebase -m --onto n1 n2 &&
+ test "a note" = "$(git notes show HEAD)"
+'
+
test_done
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 4e35137..19668c2 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -553,4 +553,28 @@ 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_done