All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/3] clone: warn users --depth is ignored in local clones
@ 2010-08-23 12:08 Nguyễn Thái Ngọc Duy
  2010-08-23 12:08 ` [PATCH v2 2/3] fetch-pack: use args.shallow to detect shallow clone instead of args.depth Nguyễn Thái Ngọc Duy
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2010-08-23 12:08 UTC (permalink / raw)
  To: Junio C Hamano, git; +Cc: Nguyễn Thái Ngọc Duy


Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 Just warn users instead of dying in the old patch.

 builtin/clone.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/builtin/clone.c b/builtin/clone.c
index efb1e6f..fcdb039 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -361,7 +361,7 @@ static void write_remote_refs(const struct ref *local_refs)
 
 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;
@@ -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)
+		warning("--depth is ignored in local clones, use file:// instead.");
 
 	if (argc == 2)
 		dir = xstrdup(argv[1]);
@@ -514,7 +517,7 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
 
 	strbuf_reset(&value);
 
-	if (path && !is_bundle) {
+	if (is_local) {
 		refs = clone_local(path, git_dir);
 		mapped_refs = wanted_peer_refs(refs, refspec);
 	} else {
-- 
1.7.1.rc1.69.g24c2f7

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-08-24 22:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-23 12:08 [PATCH v2 1/3] clone: warn users --depth is ignored in local clones Nguyễn Thái Ngọc Duy
2010-08-23 12:08 ` [PATCH v2 2/3] fetch-pack: use args.shallow to detect shallow clone instead of args.depth Nguyễn Thái Ngọc Duy
2010-08-24 16:31   ` Junio C Hamano
2010-08-24 22:14     ` Nguyen Thai Ngoc Duy
2010-08-23 12:08 ` [PATCH v2 3/3] {fetch,upload}-pack: allow --depth=0 for infinite depth Nguyễn Thái Ngọc Duy
2010-08-24 13:53   ` Jeff King
2010-08-24 17:39     ` Junio C Hamano
2010-08-24 17:46       ` Jeff King
2010-08-24 22:12     ` Nguyen Thai Ngoc Duy
2010-08-24  5:28 ` [PATCH v2 1/3] clone: warn users --depth is ignored in local clones Jonathan Nieder
2010-08-24  5:52   ` Nguyen Thai Ngoc Duy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.