Commit 00624d60 authored by Junio C Hamano's avatar Junio C Hamano

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
parents 473b8bb3 b9dbddf6
......@@ -9,6 +9,7 @@
#include "cache.h"
#include "config.h"
#include "object-store.h"
#include "blob.h"
#include "delta.h"
#include "diff.h"
......
......@@ -5,6 +5,7 @@
#include "config.h"
#include "tar.h"
#include "archive.h"
#include "object-store.h"
#include "streaming.h"
#include "run-command.h"
......
......@@ -6,6 +6,7 @@
#include "archive.h"
#include "streaming.h"
#include "utf8.h"
#include "object-store.h"
#include "userdiff.h"
#include "xdiff-interface.h"
......
#include "cache.h"
#include "config.h"
#include "refs.h"
#include "object-store.h"
#include "commit.h"
#include "tree-walk.h"
#include "attr.h"
......
#include "cache.h"
#include "refs.h"
#include "object-store.h"
#include "cache-tree.h"
#include "mergesort.h"
#include "diff.h"
......@@ -129,17 +130,19 @@ static void append_merge_parents(struct commit_list **tail)
int merge_head;
struct strbuf line = STRBUF_INIT;
merge_head = open(git_path_merge_head(), O_RDONLY);
merge_head = open(git_path_merge_head(the_repository), O_RDONLY);
if (merge_head < 0) {
if (errno == ENOENT)
return;
die("cannot open '%s' for reading", git_path_merge_head());
die("cannot open '%s' for reading",
git_path_merge_head(the_repository));
}
while (!strbuf_getwholeline_fd(&line, merge_head, '\n')) {
struct object_id oid;
if (line.len < GIT_SHA1_HEXSZ || get_oid_hex(line.buf, &oid))
die("unknown line in '%s': %s", git_path_merge_head(), line.buf);
die("unknown line in '%s': %s",
git_path_merge_head(the_repository), line.buf);
tail = append_parent(tail, &oid);
}
close(merge_head);
......
......@@ -340,13 +340,13 @@ void create_branch(const char *name, const char *start_name,
void remove_branch_state(void)
{
unlink(git_path_cherry_pick_head());
unlink(git_path_revert_head());
unlink(git_path_merge_head());
unlink(git_path_merge_rr());
unlink(git_path_merge_msg());
unlink(git_path_merge_mode());
unlink(git_path_squash_msg());
unlink(git_path_cherry_pick_head(the_repository));
unlink(git_path_revert_head(the_repository));
unlink(git_path_merge_head(the_repository));
unlink(git_path_merge_rr(the_repository));
unlink(git_path_merge_msg(the_repository));
unlink(git_path_merge_mode(the_repository));
unlink(git_path_squash_msg(the_repository));
}
void die_if_checked_out(const char *branch, int ignore_current_worktree)
......
......@@ -9,6 +9,7 @@
#include "config.h"
#include "color.h"
#include "builtin.h"
#include "repository.h"
#include "commit.h"
#include "diff.h"
#include "revision.h"
......@@ -23,6 +24,7 @@
#include "line-log.h"
#include "dir.h"
#include "progress.h"
#include "object-store.h"
#include "blame.h"
#include "string-list.h"
......@@ -576,7 +578,7 @@ static int read_ancestry(const char *graft_file)
/* The format is just "Commit Parent1 Parent2 ...\n" */
struct commit_graft *graft = read_graft_line(&buf);
if (graft)
register_commit_graft(graft, 0);
register_commit_graft(the_repository, graft, 0);
}
fclose(fp);
strbuf_release(&buf);
......
......@@ -13,6 +13,7 @@
#include "tree-walk.h"
#include "sha1-array.h"
#include "packfile.h"
#include "object-store.h"
struct batch_options {
int enabled;
......
......@@ -4,6 +4,7 @@
#include "lockfile.h"
#include "parse-options.h"
#include "refs.h"
#include "object-store.h"
#include "commit.h"
#include "tree.h"
#include "tree-walk.h"
......
......@@ -15,6 +15,7 @@
#include "fetch-pack.h"
#include "refs.h"
#include "refspec.h"
#include "object-store.h"
#include "tree.h"
#include "tree-walk.h"
#include "unpack-trees.h"
......
......@@ -5,6 +5,7 @@
*/
#include "cache.h"
#include "config.h"
#include "object-store.h"
#include "commit.h"
#include "tree.h"
#include "builtin.h"
......
......@@ -168,9 +168,9 @@ static int opt_parse_rename_score(const struct option *opt, const char *arg, int
static void determine_whence(struct wt_status *s)
{
if (file_exists(git_path_merge_head()))
if (file_exists(git_path_merge_head(the_repository)))
whence = FROM_MERGE;
else if (file_exists(git_path_cherry_pick_head())) {
else if (file_exists(git_path_cherry_pick_head(the_repository))) {
whence = FROM_CHERRY_PICK;
if (file_exists(git_path_seq_dir()))
sequencer_in_use = 1;
......@@ -718,21 +718,21 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
if (have_option_m)
strbuf_addbuf(&sb, &message);
hook_arg1 = "message";
} else if (!stat(git_path_merge_msg(), &statbuf)) {
} else if (!stat(git_path_merge_msg(the_repository), &statbuf)) {
/*
* prepend SQUASH_MSG here if it exists and a
* "merge --squash" was originally performed
*/
if (!stat(git_path_squash_msg(), &statbuf)) {
if (strbuf_read_file(&sb, git_path_squash_msg(), 0) < 0)
if (!stat(git_path_squash_msg(the_repository), &statbuf)) {
if (strbuf_read_file(&sb, git_path_squash_msg(the_repository), 0) < 0)
die_errno(_("could not read SQUASH_MSG"));
hook_arg1 = "squash";
} else
hook_arg1 = "merge";
if (strbuf_read_file(&sb, git_path_merge_msg(), 0) < 0)
if (strbuf_read_file(&sb, git_path_merge_msg(the_repository), 0) < 0)
die_errno(_("could not read MERGE_MSG"));
} else if (!stat(git_path_squash_msg(), &statbuf)) {
if (strbuf_read_file(&sb, git_path_squash_msg(), 0) < 0)
} else if (!stat(git_path_squash_msg(the_repository), &statbuf)) {
if (strbuf_read_file(&sb, git_path_squash_msg(the_repository), 0) < 0)
die_errno(_("could not read SQUASH_MSG"));
hook_arg1 = "squash";
} else if (template_file) {
......@@ -813,8 +813,8 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
" %s\n"
"and try again.\n"),
whence == FROM_MERGE ?
git_path_merge_head() :
git_path_cherry_pick_head());
git_path_merge_head(the_repository) :
git_path_cherry_pick_head(the_repository));
}
fprintf(s->fp, "\n");
......@@ -1564,7 +1564,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
if (!reflog_msg)
reflog_msg = "commit (merge)";
pptr = commit_list_append(current_head, pptr);
fp = xfopen(git_path_merge_head(), "r");
fp = xfopen(git_path_merge_head(the_repository), "r");
while (strbuf_getline_lf(&m, fp) != EOF) {
struct commit *parent;
......@@ -1575,8 +1575,8 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
}
fclose(fp);
strbuf_release(&m);
if (!stat(git_path_merge_mode(), &statbuf)) {
if (strbuf_read_file(&sb, git_path_merge_mode(), 0) < 0)
if (!stat(git_path_merge_mode(the_repository), &statbuf)) {
if (strbuf_read_file(&sb, git_path_merge_mode(the_repository), 0) < 0)
die_errno(_("could not read MERGE_MODE"));
if (!strcmp(sb.buf, "no-ff"))
allow_fast_forward = 0;
......@@ -1639,12 +1639,12 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
die("%s", err.buf);
}
unlink(git_path_cherry_pick_head());
unlink(git_path_revert_head());
unlink(git_path_merge_head());
unlink(git_path_merge_msg());
unlink(git_path_merge_mode());
unlink(git_path_squash_msg());
unlink(git_path_cherry_pick_head(the_repository));
unlink(git_path_revert_head(the_repository));
unlink(git_path_merge_head(the_repository));
unlink(git_path_merge_msg(the_repository));
unlink(git_path_merge_mode(the_repository));
unlink(git_path_squash_msg(the_repository));
if (commit_index_files())
die (_("Repository has been updated, but unable to write\n"
......
......@@ -13,6 +13,7 @@
#include "hashmap.h"
#include "argv-array.h"
#include "run-command.h"
#include "object-store.h"
#include "revision.h"
#include "list-objects.h"
#include "commit-slab.h"
......
......@@ -20,6 +20,7 @@
#include "argv-array.h"
#include "strbuf.h"
#include "lockfile.h"
#include "object-store.h"
#include "dir.h"
static char *diff_gui_tool;
......
......@@ -8,6 +8,7 @@
#include "config.h"
#include "refs.h"
#include "refspec.h"
#include "object-store.h"
#include "commit.h"
#include "object.h"
#include "tag.h"
......
......@@ -6,6 +6,7 @@
#include "repository.h"
#include "refs.h"
#include "refspec.h"
#include "object-store.h"
#include "commit.h"
#include "builtin.h"
#include "string-list.h"
......@@ -777,7 +778,7 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
const char *what, *kind;
struct ref *rm;
char *url;
const char *filename = dry_run ? "/dev/null" : git_path_fetch_head();
const char *filename = dry_run ? "/dev/null" : git_path_fetch_head(the_repository);
int want_status;
int summary_width = transport_summary_width(ref_map);
......@@ -1029,7 +1030,7 @@ static void check_not_current_branch(struct ref *ref_map)
static int truncate_fetch_head(void)
{
const char *filename = git_path_fetch_head();
const char *filename = git_path_fetch_head(the_repository);
FILE *fp = fopen_for_writing(filename);
if (!fp)
......@@ -1449,7 +1450,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
if (unshallow) {
if (depth)
die(_("--depth and --unshallow cannot be used together"));
else if (!is_repository_shallow())
else if (!is_repository_shallow(the_repository))
die(_("--unshallow on a complete repository does not make sense"));
else
depth = xstrfmt("%d", INFINITE_DEPTH);
......
......@@ -2,6 +2,7 @@
#include "cache.h"
#include "config.h"
#include "refs.h"
#include "object-store.h"
#include "commit.h"
#include "diff.h"
#include "revision.h"
......
......@@ -6,6 +6,7 @@
*/
#include "builtin.h"
#include "config.h"
#include "object-store.h"
#include "blob.h"
#include "quote.h"
#include "parse-options.h"
......
......@@ -7,6 +7,7 @@
#include "cache.h"
#include "config.h"
#include "refs.h"
#include "object-store.h"
#include "color.h"
#include "commit.h"
#include "diff.h"
......
......@@ -5,6 +5,7 @@
*/
#include "cache.h"
#include "config.h"
#include "object-store.h"
#include "blob.h"
#include "tree.h"
#include "commit.h"
......
#include "builtin.h"
#include "tree-walk.h"
#include "xdiff-interface.h"
#include "object-store.h"
#include "blob.h"
#include "exec-cmd.h"
#include "merge-blobs.h"
......
......@@ -247,9 +247,9 @@ static struct option builtin_merge_options[] = {
/* Cleans up metadata that is uninteresting after a succeeded merge. */
static void drop_save(void)
{
unlink(git_path_merge_head());
unlink(git_path_merge_msg());
unlink(git_path_merge_mode());
unlink(git_path_merge_head(the_repository));
unlink(git_path_merge_msg(the_repository));
unlink(git_path_merge_mode(the_repository));
}
static int save_state(struct object_id *stash)
......@@ -382,7 +382,7 @@ static void squash_message(struct commit *commit, struct commit_list *remotehead
oid_to_hex(&commit->object.oid));
pretty_print_commit(&ctx, commit, &out);
}
write_file_buf(git_path_squash_msg(), out.buf, out.len);
write_file_buf(git_path_squash_msg(the_repository), out.buf, out.len);
strbuf_release(&out);
}
......@@ -741,7 +741,7 @@ static void add_strategies(const char *string, unsigned attr)
static void read_merge_msg(struct strbuf *msg)
{
const char *filename = git_path_merge_msg();
const char *filename = git_path_merge_msg(the_repository);
strbuf_reset(msg);
if (strbuf_read_file(msg, filename, 0) < 0)
die_errno(_("Could not read from '%s'"), filename);
......@@ -778,18 +778,18 @@ static void prepare_to_commit(struct commit_list *remoteheads)
if (signoff)
append_signoff(&msg, ignore_non_trailer(msg.buf, msg.len), 0);
write_merge_heads(remoteheads);
write_file_buf(git_path_merge_msg(), msg.buf, msg.len);
write_file_buf(git_path_merge_msg(the_repository), msg.buf, msg.len);
if (run_commit_hook(0 < option_edit, get_index_file(), "prepare-commit-msg",
git_path_merge_msg(), "merge", NULL))
git_path_merge_msg(the_repository), "merge", NULL))
abort_commit(remoteheads, NULL);
if (0 < option_edit) {
if (launch_editor(git_path_merge_msg(), NULL, NULL))
if (launch_editor(git_path_merge_msg(the_repository), NULL, NULL))
abort_commit(remoteheads, NULL);
}
if (verify_msg && run_commit_hook(0 < option_edit, get_index_file(),
"commit-msg",
git_path_merge_msg(), NULL))
git_path_merge_msg(the_repository), NULL))
abort_commit(remoteheads, NULL);
read_merge_msg(&msg);
......@@ -859,7 +859,7 @@ static int suggest_conflicts(void)
FILE *fp;
struct strbuf msgbuf = STRBUF_INIT;
filename = git_path_merge_msg();
filename = git_path_merge_msg(the_repository);
fp = xfopen(filename, "a");
append_conflicts_hint(&msgbuf);
......@@ -942,12 +942,12 @@ static void write_merge_heads(struct commit_list *remoteheads)
}
strbuf_addf(&buf, "%s\n", oid_to_hex(oid));
}
write_file_buf(git_path_merge_head(), buf.buf, buf.len);
write_file_buf(git_path_merge_head(the_repository), buf.buf, buf.len);
strbuf_reset(&buf);
if (fast_forward == FF_NO)
strbuf_addstr(&buf, "no-ff");
write_file_buf(git_path_merge_mode(), buf.buf, buf.len);
write_file_buf(git_path_merge_mode(the_repository), buf.buf, buf.len);
strbuf_release(&buf);
}
......@@ -955,7 +955,8 @@ static void write_merge_state(struct commit_list *remoteheads)
{
write_merge_heads(remoteheads);
strbuf_addch(&merge_msg, '\n');
write_file_buf(git_path_merge_msg(), merge_msg.buf, merge_msg.len);
write_file_buf(git_path_merge_msg(the_repository), merge_msg.buf,
merge_msg.len);
}
static int default_edit_option(void)
......@@ -1038,7 +1039,7 @@ static void handle_fetch_head(struct commit_list **remotes, struct strbuf *merge
if (!merge_names)
merge_names = &fetch_head_file;
filename = git_path_fetch_head();
filename = git_path_fetch_head(the_repository);
fd = open(filename, O_RDONLY);
if (fd < 0)
die_errno(_("could not open '%s' for reading"), filename);
......@@ -1213,7 +1214,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
usage_msg_opt(_("--abort expects no arguments"),
builtin_merge_usage, builtin_merge_options);
if (!file_exists(git_path_merge_head()))
if (!file_exists(git_path_merge_head(the_repository)))
die(_("There is no merge to abort (MERGE_HEAD missing)."));
/* Invoke 'git reset --merge' */
......@@ -1229,7 +1230,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
usage_msg_opt(_("--continue expects no arguments"),
builtin_merge_usage, builtin_merge_options);
if (!file_exists(git_path_merge_head()))
if (!file_exists(git_path_merge_head(the_repository)))
die(_("There is no merge in progress (MERGE_HEAD missing)."));
/* Invoke 'git commit' */
......@@ -1240,7 +1241,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
if (read_cache_unmerged())
die_resolve_conflict("merge");
if (file_exists(git_path_merge_head())) {
if (file_exists(git_path_merge_head(the_repository))) {
/*
* There is no unmerged entry, don't advise 'git
* add/rm <file>', just 'git commit'.
......@@ -1251,7 +1252,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
else
die(_("You have not concluded your merge (MERGE_HEAD exists)."));
}
if (file_exists(git_path_cherry_pick_head())) {
if (file_exists(git_path_cherry_pick_head(the_repository))) {
if (advice_resolve_conflict)
die(_("You have not concluded your cherry-pick (CHERRY_PICK_HEAD exists).\n"
"Please, commit your changes before you merge."));
......
#include "builtin.h"
#include "tag.h"
#include "replace-object.h"
#include "object-store.h"
/*
* A signature file has a very simple fixed format: four lines
......
......@@ -7,6 +7,7 @@
#include "quote.h"
#include "tree.h"
#include "parse-options.h"
#include "object-store.h"
static struct treeent {
unsigned mode;
......
......@@ -11,6 +11,7 @@
#include "config.h"
#include "builtin.h"
#include "notes.h"
#include "object-store.h"
#include "blob.h"
#include "pretty.h"
#include "refs.h"
......
......@@ -2969,7 +2969,7 @@ static void get_object_list(int ac, const char **av)
setup_revisions(ac, av, &revs, NULL);
/* make sure shallows are read */
is_repository_shallow();
is_repository_shallow(the_repository);
while (fgets(line, sizeof(line), stdin) != NULL) {
int len = strlen(line);
......@@ -2987,7 +2987,7 @@ static void get_object_list(int ac, const char **av)
struct object_id oid;
if (get_oid_hex(line + 10, &oid))
die("not an SHA-1 '%s'", line + 10);
register_shallow(&oid);
register_shallow(the_repository, &oid);
use_bitmap_index = 0;
continue;
}
......@@ -3299,7 +3299,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
use_bitmap_index = use_bitmap_index_default;
/* "hard" reasons not to use bitmaps; these just won't work at all */
if (!use_internal_rev_list || (!pack_to_stdout && write_bitmap_index) || is_repository_shallow())
if (!use_internal_rev_list || (!pack_to_stdout && write_bitmap_index) || is_repository_shallow(the_repository))
use_bitmap_index = 0;
if (pack_to_stdout || !rev_list_all)
......
......@@ -6,6 +6,7 @@
#include "reachable.h"
#include "parse-options.h"
#include "progress.h"
#include "object-store.h"
static const char * const prune_usage[] = {
N_("git prune [-n] [-v] [--progress] [--expire <time>] [--] [<head>...]"),
......@@ -159,7 +160,7 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
remove_temporary_files(s);
free(s);
if (is_repository_shallow())
if (is_repository_shallow(the_repository))
prune_shallow(show_only);
return 0;
......
......@@ -356,7 +356,7 @@ static int git_pull_config(const char *var, const char *value, void *cb)
*/
static void get_merge_heads(struct oid_array *merge_heads)
{
const char *filename = git_path_fetch_head();
const char *filename = git_path_fetch_head(the_repository);
FILE *fp;
struct strbuf sb = STRBUF_INIT;
struct object_id oid;
......@@ -864,7 +864,7 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
if (read_cache_unmerged())
die_resolve_conflict("pull");
if (file_exists(git_path_merge_head()))
if (file_exists(git_path_merge_head(the_repository)))
die_conclude_merge();
if (get_oid("HEAD", &orig_head))
......
......@@ -25,6 +25,7 @@
#include "tmp-objdir.h"
#include "oidset.h"
#include "packfile.h"
#include "object-store.h"
#include "protocol.h"
static const char * const receive_pack_usage[] = {
......@@ -905,7 +906,7 @@ static int update_shallow_ref(struct command *cmd, struct shallow_info *si)
* not lose these new roots..
*/
for (i = 0; i < extra.nr; i++)
register_shallow(&extra.oid[i]);
register_shallow(the_repository, &extra.oid[i]);
si->shallow_ref[cmd->index] = 0;
oid_array_clear(&extra);
......
#include "builtin.h"
#include "config.h"
#include "lockfile.h"
#include "object-store.h"
#include "commit.h"
#include "refs.h"
#include "dir.h"
......
......@@ -8,6 +8,7 @@
#include "run-command.h"
#include "refs.h"
#include "refspec.h"
#include "object-store.h"
#include "argv-array.h"
static const char * const builtin_remote_usage[] = {
......
......@@ -487,7 +487,7 @@ static int create_graft(int argc, const char **argv, int force, int gentle)
static int convert_graft_file(int force)
{
const char *graft_file = get_graft_file();
const char *graft_file = get_graft_file(the_repository);
FILE *fp = fopen_or_warn(graft_file, "r");
struct strbuf buf = STRBUF_INIT, err = STRBUF_INIT;
struct argv_array args = ARGV_ARRAY_INIT;
......
......@@ -39,7 +39,7 @@ static const char *reset_type_names[] = {
static inline int is_merge(void)
{
return !access(git_path_merge_head(), F_OK);
return !access(git_path_merge_head(the_repository), F_OK);
}
static int reset_index(const struct object_id *oid, int reset_type, int quiet)
......
......@@ -6,6 +6,7 @@
#include "list-objects.h"
#include "list-objects-filter.h"
#include "list-objects-filter-options.h"
#include "object-store.h"
#include "pack.h"
#include "pack-bitmap.h"
#include "builtin.h"
......
......@@ -883,7 +883,8 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
continue;
}
if (!strcmp(arg, "--is-shallow-repository")) {
printf("%s\n", is_repository_shallow() ? "true"
printf("%s\n",
is_repository_shallow(the_repository) ? "true"
: "false");
continue;
}
......
#include "builtin.h"
#include "cache.h"
#include "refs.h"
#include "object-store.h"
#include "object.h"
#include "tag.h"
#include "string-list.h"
......
......@@ -10,6 +10,7 @@
#include "config.h"
#include "builtin.h"
#include "refs.h"
#include "object-store.h"
#include "tag.h"
#include "run-command.h"
#include "parse-options.h"
......
#include "builtin.h"
#include "config.h"
#include "object-store.h"
static char *create_temp_file(struct object_id *oid)
{
......
#include "builtin.h"
#include "cache.h"
#include "config.h"
#include "object-store.h"
#include "object.h"
#include "delta.h"
#include "pack.h"
......
......@@ -8,6 +8,7 @@
#include "cache.h"
#include "config.h"
#include "builtin.h"
#include "object-store.h"
#include "commit.h"
#include "run-command.h"
#include <signal.h>
......
......@@ -8,6 +8,7 @@
#include "pack.h"
#include "strbuf.h"
#include "packfile.h"
#include "object-store.h"
static struct bulk_checkin_state {
unsigned plugged:1;
......
#include "cache.h"
#include "lockfile.h"
#include "bundle.h"
#include "object-store.h"
#include "object.h"
#include "commit.h"
#include "diff.h"
......
......@@ -3,6 +3,7 @@
#include "tree.h"
#include "tree-walk.h"
#include "cache-tree.h"
#include "object-store.h"
#ifndef DEBUG
#define DEBUG 0
......
......@@ -484,7 +484,7 @@ extern const char *get_git_dir(void);
extern const char *get_git_common_dir(void);
extern char *get_object_directory(void);
extern char *get_index_file(void);
extern char *get_graft_file(void);
extern char *get_graft_file(struct repository *r);
extern void set_git_dir(const char *path);
extern int get_common_dir_noenv(struct strbuf *sb, const char *gitdir);
extern int get_common_dir(struct strbuf *sb, const char *gitdir);
......@@ -1192,32 +1192,6 @@ extern char *xdg_config_home(const char *filename);
*/
extern char *xdg_cache_home(const char *filename);
extern void *read_object_file_extended(const struct object_id *oid,
enum object_type *type,
unsigned long *size, int lookup_replace);
static inline void *read_object_file(const struct object_id *oid, enum object_type *type, unsigned long *size)
{
return read_object_file_extended(oid, type, size, 1);
}
/* Read and unpack an object file into memory, write memory to an object file */
int oid_object_info(struct repository *r, const struct object_id *, unsigned long *);