cat-file: use a single strbuf for all output
[gitweb.git] / cache.h
diff --git a/cache.h b/cache.h
index 87785fc83218cff355f02e2e92a7f819594e5b15..6d14702df21fcc34b7395e16941064f4ee795342 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -877,7 +877,6 @@ extern char *git_replace_ref_base;
 
 extern int fsync_object_files;
 extern int core_preload_index;
-extern int core_commit_graph;
 extern int core_apply_sparse_checkout;
 extern int precomposed_unicode;
 extern int protect_hfs;
@@ -1625,12 +1624,31 @@ int for_each_loose_file_in_objdir_buf(struct strbuf *path,
                                      void *data);
 
 /*
- * Iterate over loose objects in both the local
- * repository and any alternates repositories (unless the
- * LOCAL_ONLY flag is set).
+ * Flags for for_each_*_object(), including for_each_loose below and
+ * for_each_packed in packfile.h.
  */
-#define FOR_EACH_OBJECT_LOCAL_ONLY 0x1
-extern int for_each_loose_object(each_loose_object_fn, void *, unsigned flags);
+enum for_each_object_flags {
+       /* Iterate only over local objects, not alternates. */
+       FOR_EACH_OBJECT_LOCAL_ONLY = (1<<0),
+
+       /* Only iterate over packs obtained from the promisor remote. */
+       FOR_EACH_OBJECT_PROMISOR_ONLY = (1<<1),
+
+       /*
+        * Visit objects within a pack in packfile order rather than .idx order
+        */
+       FOR_EACH_OBJECT_PACK_ORDER = (1<<2),
+};
+
+/*
+ * Iterate over all accessible loose objects without respect to
+ * reachability. By default, this includes both local and alternate objects.
+ * The order in which objects are visited is unspecified.
+ *
+ * Any flags specific to packs are ignored.
+ */
+int for_each_loose_object(each_loose_object_fn, void *,
+                         enum for_each_object_flags flags);
 
 /*
  * Set this to 0 to prevent sha1_object_info_extended() from fetching missing