commit --amend: copy notes to the new commit
[gitweb.git] / builtin-commit.c
index f476d85293a5e2a79273054dda87073815213328..ccc4f926c09b4650751795075a8d64ab52a36b0a 100644 (file)
@@ -1340,6 +1340,12 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
        rerere(0);
        run_hook(get_index_file(), "post-commit", NULL);
        if (amend && !no_post_rewrite) {
+               struct notes_rewrite_cfg *cfg;
+               cfg = init_copy_notes_for_rewrite("amend");
+               if (cfg) {
+                       copy_note_for_rewrite(cfg, head_sha1, commit_sha1);
+                       finish_copy_notes_for_rewrite(cfg);
+               }
                run_rewrite_hook(head_sha1, commit_sha1);
        }
        if (!quiet)