Skip to content

Commit f357d46

Browse files
committed
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()
2 parents 3927312 + 0b1a95e commit f357d46

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

bundle-uri.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -795,10 +795,10 @@ int fetch_bundle_uri(struct repository *r, const char *uri,
795795
init_bundle_list(&list);
796796

797797
/*
798-
* Do not fetch a NULL or empty bundle URI. An empty bundle URI
798+
* Do not fetch an empty bundle URI. An empty bundle URI
799799
* could signal that a configured bundle URI has been disabled.
800800
*/
801-
if (!uri || !*uri) {
801+
if (!*uri) {
802802
result = 0;
803803
goto cleanup;
804804
}

notes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,13 +1020,13 @@ void init_notes(struct notes_tree *t, const char *notes_ref,
10201020
t->root = (struct int_node *) xcalloc(1, sizeof(struct int_node));
10211021
t->first_non_note = NULL;
10221022
t->prev_non_note = NULL;
1023-
t->ref = xstrdup_or_null(notes_ref);
1023+
t->ref = xstrdup(notes_ref);
10241024
t->update_ref = (flags & NOTES_INIT_WRITABLE) ? t->ref : NULL;
10251025
t->combine_notes = combine_notes;
10261026
t->initialized = 1;
10271027
t->dirty = 0;
10281028

1029-
if (flags & NOTES_INIT_EMPTY || !notes_ref ||
1029+
if (flags & NOTES_INIT_EMPTY ||
10301030
repo_get_oid_treeish(the_repository, notes_ref, &object_oid))
10311031
return;
10321032
if (flags & NOTES_INIT_WRITABLE && read_ref(notes_ref, &object_oid))

0 commit comments

Comments
 (0)