File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
configuration/steps/commands Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -46,23 +46,29 @@ def __init__(
4646 repo_url : str ,
4747 workdir : PurePath = PurePath ("." ),
4848 jobs : int = 1 ,
49+ depth : int = 1 ,
4950 ):
5051 super ().__init__ (name = "Git" , workdir = workdir )
5152 self .commit = commit
5253 self .repo_url = repo_url
5354 self .jobs = jobs
55+ self .depth = depth
5456
5557 def as_cmd_arg (self ) -> list [str ]:
58+ if self .depth != 0 :
59+ depth = "--depth " + str (self .depth )
60+ else :
61+ depth = ""
5662 return [
5763 "bash" ,
5864 "-exc" ,
5965 util .Interpolate (
6066 (
6167 "git init && "
6268 f"git remote add origin { self .repo_url } && "
63- f"git fetch -- depth 1 origin { self .commit } && "
69+ f"git fetch { depth } origin { self .commit } && "
6470 "git checkout FETCH_HEAD && "
65- f"git submodule update --init --recursive -- depth 1 --jobs={ self .jobs } "
71+ f"git submodule update --init --recursive { depth } --jobs={ self .jobs } "
6672 )
6773 ),
6874 ]
You can’t perform that action at this time.
0 commit comments