Skip to content

Commit 00624d6

Browse files
committed
Merge branch 'sb/object-store-grafts'
The conversion to pass "the_repository" and then "a_repository" throughout the object access API continues. * sb/object-store-grafts: commit: allow lookup_commit_graft to handle arbitrary repositories commit: allow prepare_commit_graft to handle arbitrary repositories shallow: migrate shallow information into the object parser path.c: migrate global git_path_* to take a repository argument cache: convert get_graft_file to handle arbitrary repositories commit: convert read_graft_file to handle arbitrary repositories commit: convert register_commit_graft to handle arbitrary repositories commit: convert commit_graft_pos() to handle arbitrary repositories shallow: add repository argument to is_repository_shallow shallow: add repository argument to check_shallow_file_for_update shallow: add repository argument to register_shallow shallow: add repository argument to set_alternate_shallow_file commit: add repository argument to lookup_commit_graft commit: add repository argument to prepare_commit_graft commit: add repository argument to read_graft_file commit: add repository argument to register_commit_graft commit: add repository argument to commit_graft_pos object: move grafts to object parser object-store: move object access functions to object-store.h
2 parents 473b8bb + b9dbddf commit 00624d6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+463
-328
lines changed

apply.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include "cache.h"
1111
#include "config.h"
12+
#include "object-store.h"
1213
#include "blob.h"
1314
#include "delta.h"
1415
#include "diff.h"

archive-tar.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "config.h"
66
#include "tar.h"
77
#include "archive.h"
8+
#include "object-store.h"
89
#include "streaming.h"
910
#include "run-command.h"
1011

archive-zip.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "archive.h"
77
#include "streaming.h"
88
#include "utf8.h"
9+
#include "object-store.h"
910
#include "userdiff.h"
1011
#include "xdiff-interface.h"
1112

archive.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "cache.h"
22
#include "config.h"
33
#include "refs.h"
4+
#include "object-store.h"
45
#include "commit.h"
56
#include "tree-walk.h"
67
#include "attr.h"

blame.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "cache.h"
22
#include "refs.h"
3+
#include "object-store.h"
34
#include "cache-tree.h"
45
#include "mergesort.h"
56
#include "diff.h"
@@ -129,17 +130,19 @@ static void append_merge_parents(struct commit_list **tail)
129130
int merge_head;
130131
struct strbuf line = STRBUF_INIT;
131132

132-
merge_head = open(git_path_merge_head(), O_RDONLY);
133+
merge_head = open(git_path_merge_head(the_repository), O_RDONLY);
133134
if (merge_head < 0) {
134135
if (errno == ENOENT)
135136
return;
136-
die("cannot open '%s' for reading", git_path_merge_head());
137+
die("cannot open '%s' for reading",
138+
git_path_merge_head(the_repository));
137139
}
138140

139141
while (!strbuf_getwholeline_fd(&line, merge_head, '\n')) {
140142
struct object_id oid;
141143
if (line.len < GIT_SHA1_HEXSZ || get_oid_hex(line.buf, &oid))
142-
die("unknown line in '%s': %s", git_path_merge_head(), line.buf);
144+
die("unknown line in '%s': %s",
145+
git_path_merge_head(the_repository), line.buf);
143146
tail = append_parent(tail, &oid);
144147
}
145148
close(merge_head);

branch.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -340,13 +340,13 @@ void create_branch(const char *name, const char *start_name,
340340

341341
void remove_branch_state(void)
342342
{
343-
unlink(git_path_cherry_pick_head());
344-
unlink(git_path_revert_head());
345-
unlink(git_path_merge_head());
346-
unlink(git_path_merge_rr());
347-
unlink(git_path_merge_msg());
348-
unlink(git_path_merge_mode());
349-
unlink(git_path_squash_msg());
343+
unlink(git_path_cherry_pick_head(the_repository));
344+
unlink(git_path_revert_head(the_repository));
345+
unlink(git_path_merge_head(the_repository));
346+
unlink(git_path_merge_rr(the_repository));
347+
unlink(git_path_merge_msg(the_repository));
348+
unlink(git_path_merge_mode(the_repository));
349+
unlink(git_path_squash_msg(the_repository));
350350
}
351351

352352
void die_if_checked_out(const char *branch, int ignore_current_worktree)

builtin/blame.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "config.h"
1010
#include "color.h"
1111
#include "builtin.h"
12+
#include "repository.h"
1213
#include "commit.h"
1314
#include "diff.h"
1415
#include "revision.h"
@@ -23,6 +24,7 @@
2324
#include "line-log.h"
2425
#include "dir.h"
2526
#include "progress.h"
27+
#include "object-store.h"
2628
#include "blame.h"
2729
#include "string-list.h"
2830

@@ -576,7 +578,7 @@ static int read_ancestry(const char *graft_file)
576578
/* The format is just "Commit Parent1 Parent2 ...\n" */
577579
struct commit_graft *graft = read_graft_line(&buf);
578580
if (graft)
579-
register_commit_graft(graft, 0);
581+
register_commit_graft(the_repository, graft, 0);
580582
}
581583
fclose(fp);
582584
strbuf_release(&buf);

builtin/cat-file.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "tree-walk.h"
1414
#include "sha1-array.h"
1515
#include "packfile.h"
16+
#include "object-store.h"
1617

1718
struct batch_options {
1819
int enabled;

builtin/checkout.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "lockfile.h"
55
#include "parse-options.h"
66
#include "refs.h"
7+
#include "object-store.h"
78
#include "commit.h"
89
#include "tree.h"
910
#include "tree-walk.h"

builtin/clone.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "fetch-pack.h"
1616
#include "refs.h"
1717
#include "refspec.h"
18+
#include "object-store.h"
1819
#include "tree.h"
1920
#include "tree-walk.h"
2021
#include "unpack-trees.h"

0 commit comments

Comments
 (0)