Add branch CLI command and tests (see ChatGPT conversation: https://chatgpt.com/share/69370ce1-8090-800f-8b08-8ecfa5089a74)

Signed-off-by: Kevin Veen-Birkenbach <kevin@veen.world>
This commit is contained in:
Kevin Veen-Birkenbach
2025-12-08 18:37:59 +01:00
parent 22b65f83d3
commit b9b64fed7d
8 changed files with 391 additions and 2 deletions

View File

@@ -15,6 +15,7 @@ from pkgmgr.cli_core.commands import (
handle_config,
handle_make,
handle_changelog,
handle_branch,
)
@@ -47,6 +48,7 @@ def dispatch_command(args, ctx: CLIContext) -> None:
"version",
"make",
"changelog",
# intentionally NOT "branch" it operates on cwd only
]
if args.command in commands_with_selection:
@@ -83,6 +85,10 @@ def dispatch_command(args, ctx: CLIContext) -> None:
handle_config(args, ctx)
elif args.command == "make":
handle_make(args, ctx, selected)
elif args.command == "branch":
# Branch commands currently operate on the current working
# directory only, not on the pkgmgr repository selection.
handle_branch(args, ctx)
else:
print(f"Unknown command: {args.command}")
sys.exit(2)