Use promisor_remote_get_direct() and has_promisor_remote()
[gitweb.git] / cache-tree.c
index c4b8a1fa16d4e1376c1df3f2784db32c20001314..64c285a746a886bc53bcc3ee0b1713ad2b50b3fc 100644 (file)
@@ -5,6 +5,7 @@
 #include "cache-tree.h"
 #include "object-store.h"
 #include "replace-object.h"
+#include "promisor-remote.h"
 
 #ifndef DEBUG
 #define DEBUG 0
@@ -225,7 +226,7 @@ int cache_tree_fully_valid(struct cache_tree *it)
        int i;
        if (!it)
                return 0;
-       if (it->entry_count < 0 || !has_sha1_file(it->oid.hash))
+       if (it->entry_count < 0 || !has_object_file(&it->oid))
                return 0;
        for (i = 0; i < it->subtree_nr; i++) {
                if (!cache_tree_fully_valid(it->down[i]->cache_tree))
@@ -253,7 +254,7 @@ static int update_one(struct cache_tree *it,
 
        *skip_count = 0;
 
-       if (0 <= it->entry_count && has_sha1_file(it->oid.hash))
+       if (0 <= it->entry_count && has_object_file(&it->oid))
                return it->entry_count;
 
        /*
@@ -357,7 +358,7 @@ static int update_one(struct cache_tree *it,
                }
 
                ce_missing_ok = mode == S_IFGITLINK || missing_ok ||
-                       (repository_format_partial_clone &&
+                       (has_promisor_remote() &&
                         ce_skip_worktree(ce));
                if (is_null_oid(oid) ||
                    (!ce_missing_ok && !has_object_file(oid))) {