From 0734600ce0f24016d190311621ea59649bc92bad Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Tue, 21 Oct 2008 07:09:27 -0700 Subject: [PATCH] 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 --- project.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/project.py b/project.py index 7c0c58f9..df1e2647 100644 --- a/project.py +++ b/project.py @@ -517,6 +517,9 @@ class Project(object): old_merge = self.bare_git.rev_parse('%s@{1}' % merge) except GitError: old_merge = merge + if old_merge == '0000000000000000000000000000000000000000' \ + or old_merge == '': + old_merge = merge else: # The upstream switched on us. Time to cross our fingers # and pray that the old upstream also wasn't in the habit