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-04-06 23:38:30 +0300
committerJunio C Hamano <gitster@pobox.com>2023-04-06 23:38:30 +0300
commit72871b198f50962a555685726e42f435cdd4efa1 (patch)
tree1ebe027331745e509d7f873b7d3a030c863ee0a6 /notes.c
parent06e9e726d463b413d45703b31881de4ed99b3417 (diff)
parent4a93b899c19794c28b140bf78a13fb9c2b34f433 (diff)
Merge branch 'ab/remove-implicit-use-of-the-repository'
Code clean-up around the use of the_repository. * ab/remove-implicit-use-of-the-repository: libs: use "struct repository *" argument, not "the_repository" post-cocci: adjust comments for recent repo_* migration cocci: apply the "revision.h" part of "the_repository.pending" cocci: apply the "rerere.h" part of "the_repository.pending" cocci: apply the "refs.h" part of "the_repository.pending" cocci: apply the "promisor-remote.h" part of "the_repository.pending" cocci: apply the "packfile.h" part of "the_repository.pending" cocci: apply the "pretty.h" part of "the_repository.pending" cocci: apply the "object-store.h" part of "the_repository.pending" cocci: apply the "diff.h" part of "the_repository.pending" cocci: apply the "commit.h" part of "the_repository.pending" cocci: apply the "commit-reach.h" part of "the_repository.pending" cocci: apply the "cache.h" part of "the_repository.pending" cocci: add missing "the_repository" macros to "pending" cocci: sort "the_repository" rules by header cocci: fix incorrect & verbose "the_repository" rules cocci: remove dead rule from "the_repository.pending.cocci"
Diffstat (limited to 'notes.c')
-rw-r--r--notes.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/notes.c b/notes.c
index a7187236e9..d40affc0f2 100644
--- a/notes.c
+++ b/notes.c
@@ -788,7 +788,7 @@ static int prune_notes_helper(const struct object_id *object_oid,
struct note_delete_list **l = (struct note_delete_list **) cb_data;
struct note_delete_list *n;
- if (has_object_file(object_oid))
+ if (repo_has_object_file(the_repository, object_oid))
return 0; /* nothing to do for this note */
/* failed to find object => prune this note */
@@ -809,13 +809,15 @@ int combine_notes_concatenate(struct object_id *cur_oid,
/* read in both note blob objects */
if (!is_null_oid(new_oid))
- new_msg = read_object_file(new_oid, &new_type, &new_len);
+ new_msg = repo_read_object_file(the_repository, new_oid,
+ &new_type, &new_len);
if (!new_msg || !new_len || new_type != OBJ_BLOB) {
free(new_msg);
return 0;
}
if (!is_null_oid(cur_oid))
- cur_msg = read_object_file(cur_oid, &cur_type, &cur_len);
+ cur_msg = repo_read_object_file(the_repository, cur_oid,
+ &cur_type, &cur_len);
if (!cur_msg || !cur_len || cur_type != OBJ_BLOB) {
free(cur_msg);
free(new_msg);
@@ -871,7 +873,7 @@ static int string_list_add_note_lines(struct string_list *list,
return 0;
/* read_sha1_file NUL-terminates */
- data = read_object_file(oid, &t, &len);
+ data = repo_read_object_file(the_repository, oid, &t, &len);
if (t != OBJ_BLOB || !data || !len) {
free(data);
return t != OBJ_BLOB || !data;
@@ -946,7 +948,7 @@ void string_list_add_refs_by_glob(struct string_list *list, const char *glob)
for_each_glob_ref(string_list_add_one_ref, glob, list);
} else {
struct object_id oid;
- if (get_oid(glob, &oid))
+ if (repo_get_oid(the_repository, glob, &oid))
warning("notes ref %s is invalid", glob);
if (!unsorted_string_list_has_string(list, glob))
string_list_append(list, glob);
@@ -1023,7 +1025,7 @@ void init_notes(struct notes_tree *t, const char *notes_ref,
t->dirty = 0;
if (flags & NOTES_INIT_EMPTY || !notes_ref ||
- get_oid_treeish(notes_ref, &object_oid))
+ repo_get_oid_treeish(the_repository, notes_ref, &object_oid))
return;
if (flags & NOTES_INIT_WRITABLE && read_ref(notes_ref, &object_oid))
die("Cannot use notes ref %s", notes_ref);
@@ -1266,7 +1268,7 @@ static void format_note(struct notes_tree *t, const struct object_id *object_oid
if (!oid)
return;
- if (!(msg = read_object_file(oid, &type, &msglen)) || type != OBJ_BLOB) {
+ if (!(msg = repo_read_object_file(the_repository, oid, &type, &msglen)) || type != OBJ_BLOB) {
free(msg);
return;
}
@@ -1350,7 +1352,7 @@ void expand_loose_notes_ref(struct strbuf *sb)
{
struct object_id object;
- if (get_oid(sb->buf, &object)) {
+ if (repo_get_oid(the_repository, sb->buf, &object)) {
/* fallback to expand_notes_ref */
expand_notes_ref(sb);
}