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 /builtin/fast-import.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 'builtin/fast-import.c')
-rw-r--r--builtin/fast-import.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/builtin/fast-import.c b/builtin/fast-import.c
index 19427e05f1..6dbe1b165e 100644
--- a/builtin/fast-import.c
+++ b/builtin/fast-import.c
@@ -1267,7 +1267,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));
}
@@ -1627,7 +1627,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),
@@ -2488,7 +2488,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,
@@ -2601,7 +2601,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;
@@ -2656,7 +2656,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,
@@ -2829,7 +2829,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);
@@ -2938,7 +2938,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);
@@ -3046,7 +3046,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));