Skip to content
Commit 2ba5a1e9 authored by Mike Frysinger's avatar Mike Frysinger
Browse files

sync: try to fast forward merge branches before checking published state



If the local branch changed state since its last upload, the data
cached in .git/config related to the last uploaded CL might not be
that relevant.  If we're able to fast forward merge to the latest
tree state, then let's do that.  This would be akin to checking
out a detached head before syncing where we already switch state.

If we aren't able to fast forward merge, then it's not a big deal
as we'll continue on to the existing branch checking logic.

This would be easy to reproduce by doing something like:
  $ repo start foo .
  $ git revert HEAD
  $ repo upload --cbr .
  $ git reset --hard HEAD^
  <CL is merged>
  $ repo sync .
  <we can fast forward>

Change-Id: I7d62f3d1ba5314a349d85b4dbb0ec8352eca18bb
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/238552
Tested-by: default avatarMike Frysinger <vapier@google.com>
Reviewed-by: default avatarMichael Mortensen <mmortensen@google.com>
Reviewed-by: default avatarMike Frysinger <vapier@google.com>
parent 3538dd22
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment