summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorThomas Rast <trast@student.ethz.ch>2010-03-12 17:04:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-03-13 05:55:40 (GMT)
commit6360d343af9acf7366be6ff89740f5077e12277b (patch)
treeae4f1e77e120cf24e951ec729a7e006a50a880a7 /t
parenteb2151bb8938a8e2af86e3ed34243af7b1c95786 (diff)
downloadgit-6360d343af9acf7366be6ff89740f5077e12277b.zip
git-6360d343af9acf7366be6ff89740f5077e12277b.tar.gz
git-6360d343af9acf7366be6ff89740f5077e12277b.tar.bz2
commit --amend: copy notes to the new commit
Teaches 'git commit --amend' to copy notes. The catch is that this must also be guarded by --no-post-rewrite, which we use to prevent --amend from copying notes during a rebase -i 'edit'/'reword'. 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/t7501-commit.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/t/t7501-commit.sh b/t/t7501-commit.sh
index 7940901..8297cb4 100755
--- a/t/t7501-commit.sh
+++ b/t/t7501-commit.sh
@@ -425,4 +425,16 @@ test_expect_success 'amend using the message from a commit named with tag' '
'
+test_expect_success 'amend can copy notes' '
+
+ git config notes.rewrite.amend true &&
+ git config notes.rewriteRef "refs/notes/*" &&
+ test_commit foo &&
+ git notes add -m"a note" &&
+ test_tick &&
+ git commit --amend -m"new foo" &&
+ test "$(git notes show)" = "a note"
+
+'
+
test_done