From 54671cc1913973c4078cb77161327fbe127dce70 Mon Sep 17 00:00:00 2001 From: Dong Zhou Date: Mon, 17 Jul 2023 22:20:22 -0400 Subject: [PATCH] support clone -g option to add cloned repo to a group (#258) --- gita/__main__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gita/__main__.py b/gita/__main__.py index 6c222ee..b2bc32b 100644 --- a/gita/__main__.py +++ b/gita/__main__.py @@ -165,6 +165,11 @@ def f_clone(args: argparse.Namespace): if not args.from_file: subprocess.run(["git", "clone", args.clonee], cwd=path) + # add the cloned repo to gita; group is also supported + cloned_path = os.path.join(path, args.clonee.split("/")[-1].split(".")[0]) + args.paths = [cloned_path] + args.recursive = args.auto_group = args.bare = args.skip_submodule = False + f_add(args) return if args.preserve_path: