summaryrefslogtreecommitdiff
path: root/transport.h
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2017-12-05 16:58:49 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-12-05 17:46:05 (GMT)
commit88e2f9ed8efaf069bea65ab6920bcdcd7c8a4da1 (patch)
tree308d906e6e67eac3be41885c4ae1f595d47231cc /transport.h
parent8e29c7c3af0b27271769052d758d818b149f45c9 (diff)
downloadgit-88e2f9ed8efaf069bea65ab6920bcdcd7c8a4da1.zip
git-88e2f9ed8efaf069bea65ab6920bcdcd7c8a4da1.tar.gz
git-88e2f9ed8efaf069bea65ab6920bcdcd7c8a4da1.tar.bz2
introduce fetch-object: fetch one promisor object
Introduce fetch-object, providing the ability to fetch one object from a promisor remote. This uses fetch-pack. To do this, the transport mechanism has been updated with 2 flags, "from-promisor" to indicate that the resulting pack comes from a promisor remote (and thus should be annotated as such by index-pack), and "no-dependents" to indicate that only the objects themselves need to be fetched (but fetching additional objects is nevertheless safe). Whenever "no-dependents" is used, fetch-pack will refrain from using any object flags, because it is most likely invoked as part of a dynamic object fetch by another Git command (which may itself use object flags). An alternative to this is to leave fetch-pack alone, and instead update the allocation of flags so that fetch-pack's flags never overlap with any others, but this will end up shrinking the number of flags available to nearly every other Git command (that is, every Git command that accesses objects), so the approach in this commit was used instead. This will be tested in a subsequent commit. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'transport.h')
-rw-r--r--transport.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/transport.h b/transport.h
index bc55715..c49a8ed 100644
--- a/transport.h
+++ b/transport.h
@@ -15,6 +15,8 @@ struct git_transport_options {
unsigned self_contained_and_connected : 1;
unsigned update_shallow : 1;
unsigned deepen_relative : 1;
+ unsigned from_promisor : 1;
+ unsigned no_dependents : 1;
int depth;
const char *deepen_since;
const struct string_list *deepen_not;
@@ -210,6 +212,15 @@ void transport_check_allowed(const char *type);
/* Send push certificates */
#define TRANS_OPT_PUSH_CERT "pushcert"
+/* Indicate that these objects are being fetched by a promisor */
+#define TRANS_OPT_FROM_PROMISOR "from-promisor"
+
+/*
+ * Indicate that only the objects wanted need to be fetched, not their
+ * dependents
+ */
+#define TRANS_OPT_NO_DEPENDENTS "no-dependents"
+
/**
* Returns 0 if the option was used, non-zero otherwise. Prints a
* message to stderr if the option is not used.