summaryrefslogtreecommitdiff
path: root/builtin/fetch-pack.c
diff options
context:
space:
mode:
authorLibravatar Jonathan Tan <jonathantanmy@google.com>2017-12-05 16:58:49 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-12-05 09:46:05 -0800
commit88e2f9ed8efaf069bea65ab6920bcdcd7c8a4da1 (patch)
tree308d906e6e67eac3be41885c4ae1f595d47231cc /builtin/fetch-pack.c
parentindex-pack: refactor writing of .keep files (diff)
downloadtgif-88e2f9ed8efaf069bea65ab6920bcdcd7c8a4da1.tar.xz
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 'builtin/fetch-pack.c')
-rw-r--r--builtin/fetch-pack.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c
index 366b9d13f9..02abe7211e 100644
--- a/builtin/fetch-pack.c
+++ b/builtin/fetch-pack.c
@@ -143,6 +143,14 @@ int cmd_fetch_pack(int argc, const char **argv, const char *prefix)
args.update_shallow = 1;
continue;
}
+ if (!strcmp("--from-promisor", arg)) {
+ args.from_promisor = 1;
+ continue;
+ }
+ if (!strcmp("--no-dependents", arg)) {
+ args.no_dependents = 1;
+ continue;
+ }
usage(fetch_pack_usage);
}
if (deepen_not.nr)