aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/notes.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/notes.c')
-rw-r--r--builtin/notes.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/notes.c b/builtin/notes.c
index 9f38863dd5..caf20fd5bd 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -9,7 +9,6 @@
#include "builtin.h"
#include "config.h"
-#include "alloc.h"
#include "editor.h"
#include "environment.h"
#include "gettext.h"
@@ -19,7 +18,6 @@
#include "object-store-ll.h"
#include "path.h"
#include "repository.h"
-#include "blob.h"
#include "pretty.h"
#include "refs.h"
#include "exec-cmd.h"
@@ -718,9 +716,11 @@ static int append_edit(int argc, const char **argv, const char *prefix)
struct strbuf buf = STRBUF_INIT;
char *prev_buf = repo_read_object_file(the_repository, note, &type, &size);
- if (prev_buf && size)
+ if (!prev_buf)
+ die(_("unable to read %s"), oid_to_hex(note));
+ if (size)
strbuf_add(&buf, prev_buf, size);
- if (d.buf.len && prev_buf && size)
+ if (d.buf.len && size)
append_separator(&buf);
strbuf_insert(&d.buf, 0, buf.buf, buf.len);