summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--environment.c2
-rw-r--r--replace-object.h5
-rw-r--r--replace_object.c3
3 files changed, 5 insertions, 5 deletions
diff --git a/environment.c b/environment.c
index 39b3d906c8..b991fc0a87 100644
--- a/environment.c
+++ b/environment.c
@@ -50,7 +50,7 @@ const char *editor_program;
const char *askpass_program;
const char *excludes_file;
enum auto_crlf auto_crlf = AUTO_CRLF_FALSE;
-int check_replace_refs = 1;
+int check_replace_refs = 1; /* NEEDSWORK: rename to read_replace_refs */
char *git_replace_ref_base;
enum eol core_eol = EOL_UNSET;
int global_conv_flags_eol = CONV_EOL_RNDTRP_WARN;
diff --git a/replace-object.h b/replace-object.h
index 15315311fb..dbc51265ec 100644
--- a/replace-object.h
+++ b/replace-object.h
@@ -3,6 +3,7 @@
#include "oidmap.h"
#include "repository.h"
+#include "object-store.h"
struct replace_object {
struct oidmap_entry original;
@@ -23,7 +24,9 @@ extern const struct object_id *do_lookup_replace_object(const struct object_id *
*/
static inline const struct object_id *lookup_replace_object(const struct object_id *oid)
{
- if (!check_replace_refs)
+ if (!check_replace_refs ||
+ (the_repository->objects->replace_map &&
+ the_repository->objects->replace_map->map.tablesize == 0))
return oid;
return do_lookup_replace_object(oid);
}
diff --git a/replace_object.c b/replace_object.c
index 953fa9cc40..b2405f6027 100644
--- a/replace_object.c
+++ b/replace_object.c
@@ -41,9 +41,6 @@ static void prepare_replace_object(void)
oidmap_init(the_repository->objects->replace_map, 0);
for_each_replace_ref(register_replace_ref, NULL);
-
- if (!the_repository->objects->replace_map->map.tablesize)
- check_replace_refs = 0;
}
/* We allow "recursive" replacement. Only within reason, though */