Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-05-02 20:13:34 +0300
committerJunio C Hamano <gitster@pobox.com>2023-05-02 20:13:34 +0300
commitf357d46adacb8d7f2c465a00c66a57d925396bfe (patch)
treebdd69f42b9b3f16329f77290b5b6697e44d3d92f /notes.c
parent39273126017b287028f7d661ef455a0a0fe20880 (diff)
parent0b1a95ef793716e7e51caf929b971ee2cbf4116d (diff)
Merge branch 'jk/misc-null-check-fixes'
Code clean-up. * jk/misc-null-check-fixes: fetch_bundle_uri(): drop pointless NULL check notes: clean up confusing NULL checks in init_notes()
Diffstat (limited to 'notes.c')
-rw-r--r--notes.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/notes.c b/notes.c
index 02f1aa39ae..ce32d96ae5 100644
--- 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))