summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-05-08 06:59:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-08 06:59:21 (GMT)
commit174774cd519846616edc475fcbc98237409ffc21 (patch)
tree604a92001e30c35c702e341c2aa835e41ce3a113 /builtin
parentb10edb2df55241b2e042b3d5473537904d09d193 (diff)
parent90e777f1e20dd6bdc022d5720a9169ea2205d9ad (diff)
downloadgit-174774cd519846616edc475fcbc98237409ffc21.zip
git-174774cd519846616edc475fcbc98237409ffc21.tar.gz
git-174774cd519846616edc475fcbc98237409ffc21.tar.bz2
Merge branch 'sb/object-store-replace'
The effort to pass the repository in-core structure throughout the API continues. This round deals with the code that implements the refs/replace/ mechanism. * sb/object-store-replace: replace-object: allow lookup_replace_object to handle arbitrary repositories replace-object: allow do_lookup_replace_object to handle arbitrary repositories replace-object: allow prepare_replace_object to handle arbitrary repositories refs: allow for_each_replace_ref to handle arbitrary repositories refs: store the main ref store inside the repository struct replace-object: add repository argument to lookup_replace_object replace-object: add repository argument to do_lookup_replace_object replace-object: add repository argument to prepare_replace_object refs: add repository argument to for_each_replace_ref refs: add repository argument to get_main_ref_store replace-object: check_replace_refs is safe in multi repo environment replace-object: eliminate replace objects prepared flag object-store: move lookup_replace_object to replace-object.h replace-object: move replace_map to object store replace_object: use oidmap
Diffstat (limited to 'builtin')
-rw-r--r--builtin/mktag.c3
-rw-r--r--builtin/pack-refs.c3
-rw-r--r--builtin/replace.c4
3 files changed, 7 insertions, 3 deletions
diff --git a/builtin/mktag.c b/builtin/mktag.c
index 9f5a50a..82a6e86 100644
--- a/builtin/mktag.c
+++ b/builtin/mktag.c
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "tag.h"
+#include "replace-object.h"
/*
* A signature file has a very simple fixed format: four lines
@@ -24,7 +25,7 @@ static int verify_object(const struct object_id *oid, const char *expected_type)
enum object_type type;
unsigned long size;
void *buffer = read_object_file(oid, &type, &size);
- const struct object_id *repl = lookup_replace_object(oid);
+ const struct object_id *repl = lookup_replace_object(the_repository, oid);
if (buffer) {
if (type == type_from_string(expected_type))
diff --git a/builtin/pack-refs.c b/builtin/pack-refs.c
index b106a39..f335356 100644
--- a/builtin/pack-refs.c
+++ b/builtin/pack-refs.c
@@ -1,6 +1,7 @@
#include "builtin.h"
#include "parse-options.h"
#include "refs.h"
+#include "repository.h"
static char const * const pack_refs_usage[] = {
N_("git pack-refs [<options>]"),
@@ -17,5 +18,5 @@ int cmd_pack_refs(int argc, const char **argv, const char *prefix)
};
if (parse_options(argc, argv, prefix, opts, pack_refs_usage, 0))
usage_with_options(pack_refs_usage, opts);
- return refs_pack_refs(get_main_ref_store(), flags);
+ return refs_pack_refs(get_main_ref_store(the_repository), flags);
}
diff --git a/builtin/replace.c b/builtin/replace.c
index 935647b..237ea65 100644
--- a/builtin/replace.c
+++ b/builtin/replace.c
@@ -14,6 +14,8 @@
#include "refs.h"
#include "parse-options.h"
#include "run-command.h"
+#include "object-store.h"
+#include "repository.h"
#include "tag.h"
static const char * const git_replace_usage[] = {
@@ -83,7 +85,7 @@ static int list_replace_refs(const char *pattern, const char *format)
"valid formats are 'short', 'medium' and 'long'\n",
format);
- for_each_replace_ref(show_reference, (void *)&data);
+ for_each_replace_ref(the_repository, show_reference, (void *)&data);
return 0;
}