summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f9c3360)
raw | patch | inline | side by side (parent: f9c3360)
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | |
Mon, 23 Aug 2010 12:08:22 +0000 (22:08 +1000) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 24 Aug 2010 16:28:02 +0000 (09:28 -0700) |
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/clone.c | patch | blob | history |
diff --git a/builtin/clone.c b/builtin/clone.c
index efb1e6faa539935de0e9dc590237185a1d222322..19ed64041d0575ee1ad49071dfe1e671114b8ae3 100644 (file)
--- a/builtin/clone.c
+++ b/builtin/clone.c
int cmd_clone(int argc, const char **argv, const char *prefix)
{
- int is_bundle = 0;
+ int is_bundle = 0, is_local;
struct stat buf;
const char *repo_name, *repo, *work_tree, *git_dir;
char *path, *dir;
repo = xstrdup(make_absolute_path(repo_name));
else
repo = repo_name;
+ is_local = path && !is_bundle;
+ if (is_local && option_depth)
+ warning("--depth is ignored in local clones; use file:// instead.");
if (argc == 2)
dir = xstrdup(argv[1]);
strbuf_reset(&value);
- if (path && !is_bundle) {
+ if (is_local) {
refs = clone_local(path, git_dir);
mapped_refs = wanted_peer_refs(refs, refspec);
} else {