From 7d24e6e95c4fa90c8db2ae03daca99a1668b0131 Mon Sep 17 00:00:00 2001 From: w1r0x Date: Thu, 23 Jun 2016 16:02:34 +0300 Subject: [PATCH] Fixes #12309 (#14121) --- lib/ansible/cli/pull.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/ansible/cli/pull.py b/lib/ansible/cli/pull.py index 87b41222b20..ccc106f3691 100644 --- a/lib/ansible/cli/pull.py +++ b/lib/ansible/cli/pull.py @@ -91,6 +91,11 @@ class PullCLI(CLI): self.parser.add_option('--verify-commit', dest='verify', default=False, action='store_true', help='verify GPG signature of checked out commit, if it fails abort running the playbook.' ' This needs the corresponding VCS module to support such an operation') + self.parser.add_option('--clean', dest='clean', default=False, action='store_true', + help='modified files in the working repository will be discarded') + self.parser.add_option('--track-subs', dest='tracksubs', default=False, action='store_true', + help='submodules will track the latest changes' + ' This is equivalent to specifying the --remote flag to git submodule update') # for pull we don't wan't a default self.parser.set_defaults(inventory=None) @@ -160,6 +165,12 @@ class PullCLI(CLI): if self.options.verify: repo_opts += ' verify_commit=yes' + if self.options.clean: + repo_opts += ' force=yes' + + if self.options.tracksubs: + repo_opts += ' track_submodules=yes' + if not self.options.fullclone: repo_opts += ' depth=1'