diff --git a/object-file.c b/object-file.c
index 0071655b69..9ba3e826ec 100644
--- a/object-file.c
+++ b/object-file.c
@@ -34,6 +34,12 @@
#include "promisor-remote.h"
#include "submodule.h"
+#define write_object_file_flags real_write_object_file_flags
+
+int real_write_object_file_flags(const void *buf, size_t len,
+ enum object_type type, struct object_id *oid,
+ unsigned flags);
+
/* The maximum size for an object header. */
#define MAX_HEADER_LEN 32