remote: add promisor and partial clone config to the doc
[gitweb.git] / builtin / cat-file.c
index cebc6d7f8a197495e7c87f6b2430f340dc224891..85ae10bf0b81bf2bb536548528dc177517f3fb49 100644 (file)
@@ -3,6 +3,7 @@
  *
  * Copyright (C) Linus Torvalds, 2005
  */
+#define USE_THE_INDEX_COMPATIBILITY_MACROS
 #include "cache.h"
 #include "config.h"
 #include "builtin.h"
@@ -14,6 +15,7 @@
 #include "sha1-array.h"
 #include "packfile.h"
 #include "object-store.h"
+#include "promisor-remote.h"
 
 struct batch_options {
        int enabled;
@@ -73,7 +75,8 @@ static int cat_one_file(int opt, const char *exp_type, const char *obj_name,
        if (unknown_type)
                flags |= OBJECT_INFO_ALLOW_UNKNOWN_TYPE;
 
-       if (get_oid_with_context(obj_name, GET_OID_RECORD_PATH,
+       if (get_oid_with_context(the_repository, obj_name,
+                                GET_OID_RECORD_PATH,
                                 &oid, &obj_context))
                die("Not a valid object name %s", obj_name);
 
@@ -209,14 +212,14 @@ struct expand_data {
 
        /*
         * After a mark_query run, this object_info is set up to be
-        * passed to sha1_object_info_extended. It will point to the data
+        * passed to oid_object_info_extended. It will point to the data
         * elements above, so you can retrieve the response from there.
         */
        struct object_info info;
 
        /*
         * This flag will be true if the requested batch format and options
-        * don't require us to call sha1_object_info, which can then be
+        * don't require us to call oid_object_info, which can then be
         * optimized out.
         */
        unsigned skip_object_info : 1;
@@ -382,7 +385,8 @@ static void batch_one_object(const char *obj_name,
        int flags = opt->follow_symlinks ? GET_OID_FOLLOW_SYMLINKS : 0;
        enum get_oid_result result;
 
-       result = get_oid_with_context(obj_name, flags, &data->oid, &ctx);
+       result = get_oid_with_context(the_repository, obj_name,
+                                     flags, &data->oid, &ctx);
        if (result != FOUND) {
                switch (result) {
                case MISSING_OBJECT:
@@ -493,7 +497,7 @@ static int batch_objects(struct batch_options *opt)
 
        /*
         * Expand once with our special mark_query flag, which will prime the
-        * object_info to be handed to sha1_object_info_extended for each
+        * object_info to be handed to oid_object_info_extended for each
         * object.
         */
        memset(&data, 0, sizeof(data));
@@ -520,8 +524,8 @@ static int batch_objects(struct batch_options *opt)
        if (opt->all_objects) {
                struct object_cb_data cb;
 
-               if (repository_format_partial_clone)
-                       warning("This repository has extensions.partialClone set. Some objects may not be loaded.");
+               if (has_promisor_remote())
+                       warning("This repository uses promisor remotes. Some objects may not be loaded.");
 
                cb.opt = opt;
                cb.expand = &data;