Update: depth limit for git clone script
This commit is contained in:
parent
b7db3777a0
commit
cdb3bb967c
|
@ -13,6 +13,13 @@ parser = argparse.ArgumentParser(
|
|||
description="Git-clone an http link as ssh instead",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--depth",
|
||||
type=int,
|
||||
required=False,
|
||||
help="Max depth to clone",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"url",
|
||||
type=str,
|
||||
|
@ -39,6 +46,9 @@ else:
|
|||
if "git.sr.ht" not in args.url and not ssh_url.endswith(".git"):
|
||||
ssh_url += ".git"
|
||||
|
||||
if args.depth is not None:
|
||||
git_cmd = ["git", "clone", "--depth", str(args.depth), ssh_url]
|
||||
else:
|
||||
git_cmd = ["git", "clone", ssh_url]
|
||||
|
||||
if args.out_name is not None:
|
||||
|
|
Loading…
Reference in a new issue