Skip to content

Commit dc46ffe

Browse files
committed
git clone depth
1 parent 9796ff3 commit dc46ffe

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pbat/core.py

+4
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,7 @@ def macro_git_clone(name, args, kwargs, ret, opts: Opts, ctx: Ctx, githubdata: G
752752

753753
branch = kwarg_value(kwargs, 'b', 'branch', 'ref')
754754
submodules = kwarg_value(kwargs, 'submodules', 'recurse-submodules')
755+
depth = kwarg_value(kwargs, 'd', 'depth')
755756

756757
basename = os.path.splitext(os.path.basename(url))[0]
757758
if dir:
@@ -763,6 +764,9 @@ def macro_git_clone(name, args, kwargs, ret, opts: Opts, ctx: Ctx, githubdata: G
763764
clone = [git, 'clone']
764765
if submodules is not None:
765766
clone.append('--recurse-submodules')
767+
if depth is not None:
768+
clone.append('--depth')
769+
clone.append(depth)
766770
clone.append(url)
767771

768772
if dir:

0 commit comments

Comments
 (0)