summaryrefslogtreecommitdiff
path: root/builtin/replace.c
diff options
context:
space:
mode:
authorLibravatar Stefan Beller <sbeller@google.com>2018-04-11 17:21:10 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-04-12 11:38:56 +0900
commit60ce76d35819a9679104b6615aa0466ae49023a0 (patch)
treeed7f7da5ccb195dfd05989c82ac01efa4e85a7ec /builtin/replace.c
parentrefs: add repository argument to get_main_ref_store (diff)
downloadtgif-60ce76d35819a9679104b6615aa0466ae49023a0.tar.xz
refs: add repository argument to for_each_replace_ref
Add a repository argument to allow for_each_replace_ref callers to be more specific about which repository to handle. This is a small mechanical change; it doesn't change the implementation to handle repositories other than the_repository yet. As with the previous commits, use a macro to catch callers passing a repository other than the_repository at compile time. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/replace.c')
-rw-r--r--builtin/replace.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin/replace.c b/builtin/replace.c
index 935647be6b..237ea656cf 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;
}