Skip to content

Commit d4110a9

Browse files
hashplinggitster
authored andcommitted
Fix clone not to ignore depth when performing a local clone
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> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 7c3c796 commit d4110a9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

git-clone.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,10 @@ fi
205205
# it is local
206206
if base=$(get_repo_base "$repo"); then
207207
repo="$base"
208-
local=yes
208+
if test -z "$depth"
209+
then
210+
local=yes
211+
fi
209212
fi
210213

211214
dir="$2"

0 commit comments

Comments
 (0)