]> git.ipfire.org Git - thirdparty/git.git/commitdiff
object-file: move `fetch_if_missing`
authorPatrick Steinhardt <ps@pks.im>
Mon, 3 Nov 2025 07:41:59 +0000 (08:41 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 3 Nov 2025 20:18:46 +0000 (12:18 -0800)
The `fetch_if_missing` global variable is declared in "object-file.h"
but defined in "odb.c". The variable relates to the whole object
database instead of only loose objects, so move the declaration into
"odb.h" accordingly.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
object-file.h
odb.h

index 3fd48dcafbf1dc797efabd489e68720e521a38d2..097e9764be169ebba2db7dd52d797d0090fa5cf7 100644 (file)
@@ -7,14 +7,6 @@
 
 struct index_state;
 
-/*
- * Set this to 0 to prevent odb_read_object_info_extended() from fetching missing
- * blobs. This has a difference only if extensions.partialClone is set.
- *
- * Its default value is 1.
- */
-extern int fetch_if_missing;
-
 enum {
        INDEX_WRITE_OBJECT = (1 << 0),
        INDEX_FORMAT_CHECK = (1 << 1),
diff --git a/odb.h b/odb.h
index 2bec895d1352f4416f51f2dab33fb3b4be318622..2346ffeca859618e3d57a88c618c70543cc631c5 100644 (file)
--- a/odb.h
+++ b/odb.h
@@ -14,6 +14,14 @@ struct strbuf;
 struct repository;
 struct multi_pack_index;
 
+/*
+ * Set this to 0 to prevent odb_read_object_info_extended() from fetching missing
+ * blobs. This has a difference only if extensions.partialClone is set.
+ *
+ * Its default value is 1.
+ */
+extern int fetch_if_missing;
+
 /*
  * Compute the exact path an alternate is at and returns it. In case of
  * error NULL is returned and the human readable error is added to `err`