Re: [PATCH 1/3] clone: do not accept --depth on local clones
- From
- Mikael Magnusson <mikachu@gmail.com>
- Date
- Aug 19, 2010, 20:49 UTC
- Message-ID
- <AANLkTimouObkUFVff8GQgGy7cDMAHXTDxGQx0gJUOO2Q@mail.gmail.com>
- In-Reply-To
- <1282214437-16384-1-git-send-email-pclouds@gmail.com>
2010/8/19 Nguyễn Thái Ngọc Duy <pclouds@gmail.com>:
Show 20 quoted lines
>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
> builtin/clone.c | 7 +++++--
> 1 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/builtin/clone.c b/builtin/clone.c
> index efb1e6f..215c432 100644
> --- a/builtin/clone.c
> +++ b/builtin/clone.c
> @@ -414,6 +414,9 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
> repo = xstrdup(make_absolute_path(repo_name));
> else
> repo = repo_name;
> + is_local = path && !is_bundle;
> + if (is_local && option_depth)
> + die("local clone with --depth does not make sense");
>
> if (argc == 2)
> dir = xstrdup(argv[1]);Wouldn't it be more helpful to also say "Use the file:///blabla syntax instead" or just automatically fall back to that protocol when --depth is used?
-- Mikael Magnusson