]> git.ipfire.org Git - thirdparty/git.git/blobdiff - notes.c
Merge branch 'jk/misc-null-check-fixes'
[thirdparty/git.git] / notes.c
diff --git a/notes.c b/notes.c
index 02f1aa39ae19e575cfbdc3c2a57873751c273159..ce32d96ae515ac36350a1092b156b04fd0ca4cce 100644 (file)
--- a/notes.c
+++ b/notes.c
@@ -1020,13 +1020,13 @@ void init_notes(struct notes_tree *t, const char *notes_ref,
        t->root = (struct int_node *) xcalloc(1, sizeof(struct int_node));
        t->first_non_note = NULL;
        t->prev_non_note = NULL;
-       t->ref = xstrdup_or_null(notes_ref);
+       t->ref = xstrdup(notes_ref);
        t->update_ref = (flags & NOTES_INIT_WRITABLE) ? t->ref : NULL;
        t->combine_notes = combine_notes;
        t->initialized = 1;
        t->dirty = 0;
 
-       if (flags & NOTES_INIT_EMPTY || !notes_ref ||
+       if (flags & NOTES_INIT_EMPTY ||
            repo_get_oid_treeish(the_repository, notes_ref, &object_oid))
                return;
        if (flags & NOTES_INIT_WRITABLE && read_ref(notes_ref, &object_oid))