Merge branch 'ab/remove-implicit-use-of-the-repository' into en/header-split-cache-h
* 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"
This commit is contained in:
@@ -1270,7 +1270,7 @@ static void load_tree(struct tree_entry *root)
|
||||
die("Can't load tree %s", oid_to_hex(oid));
|
||||
} else {
|
||||
enum object_type type;
|
||||
buf = read_object_file(oid, &type, &size);
|
||||
buf = repo_read_object_file(the_repository, oid, &type, &size);
|
||||
if (!buf || type != OBJ_TREE)
|
||||
die("Can't load tree %s", oid_to_hex(oid));
|
||||
}
|
||||
@@ -1630,7 +1630,7 @@ static int update_branch(struct branch *b)
|
||||
if (!old_cmit || !new_cmit)
|
||||
return error("Branch %s is missing commits.", b->name);
|
||||
|
||||
if (!in_merge_bases(old_cmit, new_cmit)) {
|
||||
if (!repo_in_merge_bases(the_repository, old_cmit, new_cmit)) {
|
||||
warning("Not updating %s"
|
||||
" (new tip %s does not contain %s)",
|
||||
b->name, oid_to_hex(&b->oid),
|
||||
@@ -2491,7 +2491,7 @@ static void note_change_n(const char *p, struct branch *b, unsigned char *old_fa
|
||||
if (commit_oe->type != OBJ_COMMIT)
|
||||
die("Mark :%" PRIuMAX " not a commit", commit_mark);
|
||||
oidcpy(&commit_oid, &commit_oe->idx.oid);
|
||||
} else if (!get_oid(p, &commit_oid)) {
|
||||
} else if (!repo_get_oid(the_repository, p, &commit_oid)) {
|
||||
unsigned long size;
|
||||
char *buf = read_object_with_reference(the_repository,
|
||||
&commit_oid,
|
||||
@@ -2604,7 +2604,7 @@ static int parse_objectish(struct branch *b, const char *objectish)
|
||||
} else
|
||||
parse_from_existing(b);
|
||||
}
|
||||
} else if (!get_oid(objectish, &b->oid)) {
|
||||
} else if (!repo_get_oid(the_repository, objectish, &b->oid)) {
|
||||
parse_from_existing(b);
|
||||
if (is_null_oid(&b->oid))
|
||||
b->delete = 1;
|
||||
@@ -2659,7 +2659,7 @@ static struct hash_list *parse_merge(unsigned int *count)
|
||||
if (oe->type != OBJ_COMMIT)
|
||||
die("Mark :%" PRIuMAX " not a commit", idnum);
|
||||
oidcpy(&n->oid, &oe->idx.oid);
|
||||
} else if (!get_oid(from, &n->oid)) {
|
||||
} else if (!repo_get_oid(the_repository, from, &n->oid)) {
|
||||
unsigned long size;
|
||||
char *buf = read_object_with_reference(the_repository,
|
||||
&n->oid,
|
||||
@@ -2832,7 +2832,7 @@ static void parse_new_tag(const char *arg)
|
||||
oe = find_mark(marks, from_mark);
|
||||
type = oe->type;
|
||||
oidcpy(&oid, &oe->idx.oid);
|
||||
} else if (!get_oid(from, &oid)) {
|
||||
} else if (!repo_get_oid(the_repository, from, &oid)) {
|
||||
struct object_entry *oe = find_object(&oid);
|
||||
if (!oe) {
|
||||
type = oid_object_info(the_repository, &oid, NULL);
|
||||
@@ -2941,7 +2941,7 @@ static void cat_blob(struct object_entry *oe, struct object_id *oid)
|
||||
char *buf;
|
||||
|
||||
if (!oe || oe->pack_id == MAX_PACK_ID) {
|
||||
buf = read_object_file(oid, &type, &size);
|
||||
buf = repo_read_object_file(the_repository, oid, &type, &size);
|
||||
} else {
|
||||
type = oe->type;
|
||||
buf = gfi_unpack_entry(oe, &size);
|
||||
@@ -3049,7 +3049,8 @@ static struct object_entry *dereference(struct object_entry *oe,
|
||||
buf = gfi_unpack_entry(oe, &size);
|
||||
} else {
|
||||
enum object_type unused;
|
||||
buf = read_object_file(oid, &unused, &size);
|
||||
buf = repo_read_object_file(the_repository, oid, &unused,
|
||||
&size);
|
||||
}
|
||||
if (!buf)
|
||||
die("Can't load object %s", oid_to_hex(oid));
|
||||
|
||||
Reference in New Issue
Block a user