git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Fix clone not to ignore depth when performing a local clone

From
Charles Bailey <charles@hashpling.org>
Date
Dec 11, 2007, 06:47 UTC
Message-ID
<20071211064731.GA30525@hashpling.org>

When git-clone detects that it can perform a local clone it follows a path that silently ignores the depth parameter.

Presumably if the user explicitly requests a shallow clone they have a reason to prefer a space efficient clone of just the recent history so bypass the local magic if the user specifies the depth parameter.

Signed-off-by: Charles Bailey <charles@hashpling.org>
---
 git-clone.sh |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/git-clone.sh b/git-clone.sh
index ecf9d89..fb124d8 100755
--- a/git-clone.sh
+++ b/git-clone.sh
@@ -205,7 +205,10 @@ fi
 # it is local
 if base=$(get_repo_base "$repo"); then
 	repo="$base"
-	local=yes
+	if test -z "$depth"
+	then
+		local=yes
+	fi
 fi
 
 dir="$2"
-- 
1.5.3.7.2242.gcc945-dirty
Next: Johannes Schindelin
Message 1 of 3 in “Fix clone not to ignore depth when performing a local clone”
  1. Fix clone not to ignore depth when performing a local cloneCharles Bailey, Dec 11, 2007
  2. Johannes SchindelinDec 11, 2007
  3. Charles BaileyDec 11, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.