@@ -330,10 +330,10 @@ static int notes_copy_from_stdin(int force, const char *rewrite_cmd)
330330 }
331331
332332 if (!rewrite_cmd ) {
333- commit_notes (t , msg );
333+ commit_notes (the_repository , t , msg );
334334 free_notes (t );
335335 } else {
336- finish_copy_notes_for_rewrite (c , msg );
336+ finish_copy_notes_for_rewrite (the_repository , c , msg );
337337 }
338338 strbuf_release (& buf );
339339 return ret ;
@@ -469,12 +469,14 @@ static int add(int argc, const char **argv, const char *prefix)
469469 write_note_data (& d , & new_note );
470470 if (add_note (t , & object , & new_note , combine_notes_overwrite ))
471471 BUG ("combine_notes_overwrite failed" );
472- commit_notes (t , "Notes added by 'git notes add'" );
472+ commit_notes (the_repository , t ,
473+ "Notes added by 'git notes add'" );
473474 } else {
474475 fprintf (stderr , _ ("Removing note for object %s\n" ),
475476 oid_to_hex (& object ));
476477 remove_note (t , object .hash );
477- commit_notes (t , "Notes removed by 'git notes add'" );
478+ commit_notes (the_repository , t ,
479+ "Notes removed by 'git notes add'" );
478480 }
479481
480482 free_note_data (& d );
@@ -552,7 +554,8 @@ static int copy(int argc, const char **argv, const char *prefix)
552554
553555 if (add_note (t , & object , from_note , combine_notes_overwrite ))
554556 BUG ("combine_notes_overwrite failed" );
555- commit_notes (t , "Notes added by 'git notes copy'" );
557+ commit_notes (the_repository , t ,
558+ "Notes added by 'git notes copy'" );
556559out :
557560 free_notes (t );
558561 return retval ;
@@ -636,7 +639,7 @@ static int append_edit(int argc, const char **argv, const char *prefix)
636639 remove_note (t , object .hash );
637640 logmsg = xstrfmt ("Notes removed by 'git notes %s'" , argv [0 ]);
638641 }
639- commit_notes (t , logmsg );
642+ commit_notes (the_repository , t , logmsg );
640643
641644 free (logmsg );
642645 free_note_data (& d );
@@ -937,7 +940,8 @@ static int remove_cmd(int argc, const char **argv, const char *prefix)
937940 strbuf_release (& sb );
938941 }
939942 if (!retval )
940- commit_notes (t , "Notes removed by 'git notes remove'" );
943+ commit_notes (the_repository , t ,
944+ "Notes removed by 'git notes remove'" );
941945 free_notes (t );
942946 return retval ;
943947}
@@ -965,7 +969,8 @@ static int prune(int argc, const char **argv, const char *prefix)
965969 prune_notes (t , (verbose ? NOTES_PRUNE_VERBOSE : 0 ) |
966970 (show_only ? NOTES_PRUNE_VERBOSE |NOTES_PRUNE_DRYRUN : 0 ) );
967971 if (!show_only )
968- commit_notes (t , "Notes removed by 'git notes prune'" );
972+ commit_notes (the_repository , t ,
973+ "Notes removed by 'git notes prune'" );
969974 free_notes (t );
970975 return 0 ;
971976}
0 commit comments