]> git.ipfire.org Git - thirdparty/git.git/blobdiff - bundle-uri.h
mingw: use lowercase includes for some Windows headers
[thirdparty/git.git] / bundle-uri.h
index d5e89f1671caa3717b35242f20b8993cea32d14f..6dbc780f661bc06bbc9f0badddec91101814349c 100644 (file)
@@ -42,6 +42,12 @@ struct remote_bundle_info {
         * this boolean is true.
         */
        unsigned unbundled:1;
+
+       /**
+        * If the bundle is part of a list with the creationToken
+        * heuristic, then we use this member for sorting the bundles.
+        */
+       uint64_t creationToken;
 };
 
 #define REMOTE_BUNDLE_INFO_INIT { 0 }
@@ -52,6 +58,14 @@ enum bundle_list_mode {
        BUNDLE_MODE_ANY
 };
 
+enum bundle_list_heuristic {
+       BUNDLE_HEURISTIC_NONE = 0,
+       BUNDLE_HEURISTIC_CREATIONTOKEN,
+
+       /* Must be last. */
+       BUNDLE_HEURISTIC__COUNT
+};
+
 /**
  * A bundle_list contains an unordered set of remote_bundle_info structs,
  * as well as information about the bundle listing, such as version and
@@ -75,6 +89,12 @@ struct bundle_list {
         * advertised by the bundle list at that location.
         */
        char *baseURI;
+
+       /**
+        * A list can have a heuristic, which helps reduce the number of
+        * downloaded bundles.
+        */
+       enum bundle_list_heuristic heuristic;
 };
 
 void init_bundle_list(struct bundle_list *list);
@@ -104,8 +124,14 @@ int bundle_uri_parse_config_format(const char *uri,
  * based on that information.
  *
  * Returns non-zero if no bundle information is found at the given 'uri'.
+ *
+ * If the pointer 'has_heuristic' is non-NULL, then the value it points to
+ * will be set to be non-zero if and only if the fetched list has a
+ * heuristic value. Such a value indicates that the list was designed for
+ * incremental fetches.
  */
-int fetch_bundle_uri(struct repository *r, const char *uri);
+int fetch_bundle_uri(struct repository *r, const char *uri,
+                    int *has_heuristic);
 
 /**
  * Given a bundle list that was already advertised (likely by the