kas: Support --force-checkout argument

When checking out a repository the default behaviour is to abort if
local changes are present. If the new `--force-checkout` argument is
passed on the command line then any local changes will instead be
discarded so that the desired refspec can be checked out.

Signed-off-by: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Paul Barker
2020-06-15 22:03:30 +02:00
committed by Jan Kiszka
parent 90598db3c8
commit 1569895001
3 changed files with 21 additions and 8 deletions

View File

@@ -106,6 +106,9 @@ def setup_parser_common_args(parser):
parser.add_argument('--skip',
help='Skip build steps',
default=[])
parser.add_argument('--force-checkout', action='store_true',
help='Always checkout the desired refspec of each '
'repository, discarding any local changes')
def kas_get_argparser():
"""