Merge branch 'ds/object-info-for-prefetch-fix'
authorJunio C Hamano <gitster@pobox.com>
Mon, 17 Jun 2019 17:15:14 +0000 (10:15 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Jun 2019 17:15:14 +0000 (10:15 -0700)
Code cleanup and futureproof.

* ds/object-info-for-prefetch-fix:
sha1-file: split OBJECT_INFO_FOR_PREFETCH

object-store.h
sha1-file.c
index 272e01e452b97bd8598a76d6facc5a6f803b579a..49f56ab8d9608919808ecebe71b9deb30c53980b 100644 (file)
@@ -277,10 +277,14 @@ struct object_info {
 #define OBJECT_INFO_IGNORE_LOOSE 16
 /*
  * Do not attempt to fetch the object if missing (even if fetch_is_missing is
- * nonzero). This is meant for bulk prefetching of missing blobs in a partial
- * clone. Implies OBJECT_INFO_QUICK.
+ * nonzero).
  */
-#define OBJECT_INFO_FOR_PREFETCH (32 + OBJECT_INFO_QUICK)
+#define OBJECT_INFO_SKIP_FETCH_OBJECT 32
+/*
+ * This is meant for bulk prefetching of missing blobs in a partial
+ * clone. Implies OBJECT_INFO_SKIP_FETCH_OBJECT and OBJECT_INFO_QUICK
+ */
+#define OBJECT_INFO_FOR_PREFETCH (OBJECT_INFO_SKIP_FETCH_OBJECT | OBJECT_INFO_QUICK)
 
 int oid_object_info_extended(struct repository *r,
                             const struct object_id *,
index ed5c50dac427f2f3aa2b9b7b203bf2355049b163..888b6024d5de050753765e37b65ea0521d91f9fd 100644 (file)
@@ -1379,7 +1379,7 @@ int oid_object_info_extended(struct repository *r, const struct object_id *oid,
                /* Check if it is a missing object */
                if (fetch_if_missing && repository_format_partial_clone &&
                    !already_retried && r == the_repository &&
-                   !(flags & OBJECT_INFO_FOR_PREFETCH)) {
+                   !(flags & OBJECT_INFO_SKIP_FETCH_OBJECT)) {
                        /*
                         * TODO Investigate having fetch_object() return
                         * TODO error/success and stopping the music here.