mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
Fix 'repo sync' rebase logic on a published branch
If the current branch is published, but all published commits are merged into the manifest revision, but there is also at least one unpublished commit on the current branch, we should rebase the unpublished commit, rather than creating a merge commit. Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
parent
eb7af87bcf
commit
05f66b6836
@ -682,18 +682,15 @@ class Project(object):
|
|||||||
branch.name,
|
branch.name,
|
||||||
len(upstream_gain))
|
len(upstream_gain))
|
||||||
return
|
return
|
||||||
elif upstream_gain:
|
elif pub == head:
|
||||||
# We can fast-forward safely.
|
# All published commits are merged, and thus we are a
|
||||||
|
# strict subset. We can fast-forward safely.
|
||||||
#
|
#
|
||||||
def _doff():
|
def _doff():
|
||||||
self._FastForward(rev)
|
self._FastForward(rev)
|
||||||
self._CopyFiles()
|
self._CopyFiles()
|
||||||
syncbuf.later1(self, _doff)
|
syncbuf.later1(self, _doff)
|
||||||
return
|
return
|
||||||
else:
|
|
||||||
# Trivially no changes in the upstream.
|
|
||||||
#
|
|
||||||
return
|
|
||||||
|
|
||||||
if merge == rev:
|
if merge == rev:
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user