Skip to content

Commit fc8c117

Browse files
committed
clone: --bundle-uri cannot be combined with --depth
The previous change added the '--bundle-uri' option, but did not check if the --depth parameter was included. Since bundles are not compatible with shallow clones, provide an error message to the user who is attempting this combination. I am leaving this as its own change, separate from the one that implements '--bundle-uri', because this is more of an advisory for the user. There is nothing wrong with bootstrapping with bundles and then fetching a shallow clone. However, that is likely going to involve too much work for the client _and_ the server. The client will download all of this bundle information containing the full history of the repository only to ignore most of it. The server will get a shallow fetch request, but with a list of haves that might cause a more painful computation of that shallow pack-file. RFC-TODO: add a test case for this error message. Signed-off-by: Derrick Stolee <[email protected]>
1 parent 3516fab commit fc8c117

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

builtin/clone.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -926,6 +926,11 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
926926
option_no_checkout = 1;
927927
}
928928

929+
if (bundle_uri) {
930+
if (deepen)
931+
die(_("--bundle-uri is incompatible with --depth, --shallow-since, and --shallow-exclude"));
932+
}
933+
929934
repo_name = argv[0];
930935

931936
path = get_repo_path(repo_name, &is_bundle);

0 commit comments

Comments
 (0)