From: Teng Long <dyroneteng@xxxxxxxxx> Situation of removing note shouldn't happen in "append_edit()", unless it's a bug. So, let's drop the unreachable "else" code in "append_edit()". Signed-off-by: Teng Long <dyroneteng@xxxxxxxxx> --- builtin/notes.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/builtin/notes.c b/builtin/notes.c index 02b88e54d8..6d42592c79 100644 --- a/builtin/notes.c +++ b/builtin/notes.c @@ -10,6 +10,7 @@ #include "cache.h" #include "config.h" #include "builtin.h" +#include "git-compat-util.h" #include "notes.h" #include "object-store.h" #include "repository.h" @@ -646,11 +647,7 @@ static int append_edit(int argc, const char **argv, const char *prefix) _("Both original and appended notes are empty in %s, do nothing\n"), oid_to_hex(&object)); } else { - fprintf(stderr, _("Removing note for object %s\n"), - oid_to_hex(&object)); - remove_note(t, object.hash); - logmsg = xstrfmt("Notes removed by 'git notes %s'", argv[0]); - commit_notes(the_repository, t, logmsg); + BUG("compute_notes failed"); } free(logmsg); -- 2.38.1.383.ge7205ac0a40.dirty