summaryrefslogtreecommitdiff
path: root/packfile.h
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2017-12-05 16:58:44 +0000
committerJunio C Hamano <gitster@pobox.com>2017-12-05 09:46:05 -0800
commit498f1f61f123fd66eccc05c1d19356b25b4225b2 (patch)
tree3fa7494f318e935748085627f7e5d4215327d85e /packfile.h
parent75b97fec171dbbf7ec73960cefb50c265cfb7af7 (diff)
downloadgit-498f1f61f123fd66eccc05c1d19356b25b4225b2.tar.gz
fsck: introduce partialclone extension
Currently, Git does not support repos with very large numbers of objects or repos that wish to minimize manipulation of certain blobs (for example, because they are very large) very well, even if the user operates mostly on part of the repo, because Git is designed on the assumption that every referenced object is available somewhere in the repo storage. In such an arrangement, the full set of objects is usually available in remote storage, ready to be lazily downloaded. Teach fsck about the new state of affairs. In this commit, teach fsck that missing promisor objects referenced from the reflog are not an error case; in future commits, fsck will be taught about other cases. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'packfile.h')
-rw-r--r--packfile.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/packfile.h b/packfile.h
index 0cdeb54dcd..a7fca598d6 100644
--- a/packfile.h
+++ b/packfile.h
@@ -1,6 +1,8 @@
#ifndef PACKFILE_H
#define PACKFILE_H
+#include "oidset.h"
+
/*
* Generate the filename to be used for a pack file with checksum "sha1" and
* extension "ext". The result is written into the strbuf "buf", overwriting
@@ -125,6 +127,11 @@ extern int has_sha1_pack(const unsigned char *sha1);
extern int has_pack_index(const unsigned char *sha1);
/*
+ * Only iterate over packs obtained from the promisor remote.
+ */
+#define FOR_EACH_OBJECT_PROMISOR_ONLY 2
+
+/*
* Iterate over packed objects in both the local
* repository and any alternates repositories (unless the
* FOR_EACH_OBJECT_LOCAL_ONLY flag, defined in cache.h, is set).
@@ -135,4 +142,10 @@ typedef int each_packed_object_fn(const struct object_id *oid,
void *data);
extern int for_each_packed_object(each_packed_object_fn, void *, unsigned flags);
+/*
+ * Return 1 if an object in a promisor packfile is or refers to the given
+ * object, 0 otherwise.
+ */
+extern int is_promisor_object(const struct object_id *oid);
+
#endif