Support --nocommit option to git-cl-patch for gerrit.
R=agable@chromium.org,tandrii@chromium.org
Bug:
Change-Id: I7a5ec6ca1bb05d67b1ddbee60eac89d57464a480
Reviewed-on: https://chromium-review.googlesource.com/710007
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Stefan Zager <szager@chromium.org>
diff --git a/git_cl.py b/git_cl.py
index 0057b0b..1cec904 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -2782,7 +2782,6 @@
def CMDPatchWithParsedIssue(self, parsed_issue_arg, reject, nocommit,
directory, force):
assert not reject
- assert not nocommit
assert not directory
assert parsed_issue_arg.valid
@@ -2817,6 +2816,9 @@
RunGit(['reset', '--hard', 'FETCH_HEAD'])
print('Checked out commit for change %i patchset %i locally' %
(parsed_issue_arg.issue, patchset))
+ elif nocommit:
+ RunGit(['cherry-pick', '--no-commit', 'FETCH_HEAD'])
+ print('Patch applied to index.')
else:
RunGit(['cherry-pick', 'FETCH_HEAD'])
print('Committed patch for change %i patchset %i locally.' %
@@ -5408,8 +5410,6 @@
if cl.IsGerrit():
if options.reject:
parser.error('--reject is not supported with Gerrit codereview.')
- if options.nocommit:
- parser.error('--nocommit is not supported with Gerrit codereview.')
if options.directory:
parser.error('--directory is not supported with Gerrit codereview.')