From caefa8602b4ec8d069f1547c5cc9fcf3567d0f3f Mon Sep 17 00:00:00 2001 From: Li Wen Date: Wed, 21 Aug 2024 11:23:00 +0800 Subject: [PATCH] Make repo branch configurable --- harvest/__init__.py | 2 +- harvest/cli.py | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/harvest/__init__.py b/harvest/__init__.py index de74e65..1ee3096 100644 --- a/harvest/__init__.py +++ b/harvest/__init__.py @@ -13,4 +13,4 @@ # limitations under the License. """The Auditree file collating and reporting tool.""" -__version__ = "1.3.0" +__version__ = "1.3.1" diff --git a/harvest/cli.py b/harvest/cli.py index 0cc3f09..e3b7e05 100644 --- a/harvest/cli.py +++ b/harvest/cli.py @@ -44,6 +44,14 @@ def _init_arguments(self): "or: local - if working exclusively with a local git repo" ), ) + self.add_argument( + "--branch", + help=( + "which branch you wish to retrieve git repo evidence from - " + "default is master" + ), + default="master", + ) self.add_argument( "--repo-path", help=( @@ -140,7 +148,7 @@ def _run(self, args): collator = Collator( args.repo, Config(args.creds) if args.creds else None, - "master", + args.branch, args.repo_path, args.no_validate, include_file_path=args.include_file_path, @@ -196,7 +204,7 @@ def _run(self, args): reporter = self.report( args.repo, Config(args.creds) if args.creds else None, - "master", + args.branch, args.repo_path, self.template_dir, args.no_validate,