diff options
author | Shawn O. Pearce <sop@google.com> | 2008-10-21 07:09:27 -0700 |
---|---|---|
committer | Shawn O. Pearce <sop@google.com> | 2008-10-21 07:12:36 -0700 |
commit | 0734600ce0f24016d190311621ea59649bc92bad (patch) | |
tree | 178b43053e592c35f8cddc5e948145b7fd421530 | |
parent | cf31fe9b4fb650b27e19f5d7ee7297e383660caf (diff) | |
download | git-repo-0734600ce0f24016d190311621ea59649bc92bad.tar.gz |
Fix 'repo sync' when the remote reflog has only 1 entry
If the reflog for the upstream branch has only 1 entry in it, as
the branch has been updated only once, we can get back the 0{40}
object id from `git rev-parse upstream@{1}`, in which case we should
consider it to be the same as if upstream@{1} is not defined.
Signed-off-by: Shawn O. Pearce <sop@google.com>
-rw-r--r-- | project.py | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -517,6 +517,9 @@ class Project(object): | |||
517 | old_merge = self.bare_git.rev_parse('%s@{1}' % merge) | 517 | old_merge = self.bare_git.rev_parse('%s@{1}' % merge) |
518 | except GitError: | 518 | except GitError: |
519 | old_merge = merge | 519 | old_merge = merge |
520 | if old_merge == '0000000000000000000000000000000000000000' \ | ||
521 | or old_merge == '': | ||
522 | old_merge = merge | ||
520 | else: | 523 | else: |
521 | # The upstream switched on us. Time to cross our fingers | 524 | # The upstream switched on us. Time to cross our fingers |
522 | # and pray that the old upstream also wasn't in the habit | 525 | # and pray that the old upstream also wasn't in the habit |