Merge remote-tracking branch 'refs/remotes/lab/main'

This commit is contained in:
Akemi Izuko 2023-12-23 20:14:15 -07:00
commit eae6bf4be8
Signed by: akemi
GPG key ID: 8DE0764E1809E9FC

View file

@ -13,6 +13,13 @@ parser = argparse.ArgumentParser(
description="Git-clone an http link as ssh instead", 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( parser.add_argument(
"url", "url",
type=str, type=str,
@ -39,7 +46,10 @@ else:
if "git.sr.ht" not in args.url and not ssh_url.endswith(".git"): if "git.sr.ht" not in args.url and not ssh_url.endswith(".git"):
ssh_url += ".git" ssh_url += ".git"
git_cmd = ["git", "clone", ssh_url] 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: if args.out_name is not None:
git_cmd.append(args.out_name) git_cmd.append(args.out_name)