mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
download: support --ff when cherry-picking
The git cherry-pick already supports this, so plumb the existing repo option down. Otherwise it's confusing when people use -c --ff and it doesn't use that behavior. Change-Id: Id68932ffa09204bb30b92a21aff185c00394a520 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/259852 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
parent
58ac1678e8
commit
ea43176de0
@ -2681,8 +2681,10 @@ class Project(object):
|
||||
if self._allrefs:
|
||||
raise GitError('%s checkout %s ' % (self.name, rev))
|
||||
|
||||
def _CherryPick(self, rev):
|
||||
def _CherryPick(self, rev, ffonly=False):
|
||||
cmd = ['cherry-pick']
|
||||
if ffonly:
|
||||
cmd.append('--ff')
|
||||
cmd.append(rev)
|
||||
cmd.append('--')
|
||||
if GitCommand(self, cmd).Wait() != 0:
|
||||
|
@ -101,7 +101,7 @@ If no project is specified try to use current directory as a project.
|
||||
print(' %s' % (c), file=sys.stderr)
|
||||
if opt.cherrypick:
|
||||
try:
|
||||
project._CherryPick(dl.commit)
|
||||
project._CherryPick(dl.commit, ffonly=opt.ffonly)
|
||||
except GitError:
|
||||
print('[%s] Could not complete the cherry-pick of %s'
|
||||
% (project.name, dl.commit), file=sys.stderr)
|
||||
|
Loading…
Reference in New Issue
Block a user