@@ -327,7 +327,8 @@ or `--mirror` is given)
Before fetching from the remote, fetch a bundle from the given
`<uri>` and unbundle the data into the local repository. The refs
in the bundle will be stored under the hidden `refs/bundle/*`
- namespace.
+ namespace. This option is incompatible with `--depth`,
+ `--shallow-since`, and `--shallow-exclude`.
:git-clone: 1
include::urls.txt[]
@@ -937,6 +937,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
option_no_checkout = 1;
}
+ if (bundle_uri && deepen)
+ die(_("--bundle-uri is incompatible with --depth, --shallow-since, and --shallow-exclude"));
+
repo_name = argv[0];
path = get_repo_path(repo_name, &is_bundle);
@@ -58,6 +58,14 @@ test_expect_success 'disallows --bare with --separate-git-dir' '
'
+test_expect_success 'disallows --bundle-uri with shallow options' '
+ for option in --depth=1 --shallow-since=01-01-2000 --shallow-exclude=HEAD
+ do
+ test_must_fail git clone --bundle-uri=bundle $option from to 2>err &&
+ grep "bundle-uri is incompatible" err || return 1
+ done
+'
+
test_expect_success 'reject cloning shallow repository' '
test_when_finished "rm -rf repo" &&
test_must_fail git clone --reject-shallow shallow-repo out 2>err &&