Ticket #2127 (closed defect: fixed)
Git 1.7.7: Recent change causes buildbot to always fail to fetch from git
| Reported by: | cdavis5x | Owned by: | |
|---|---|---|---|
| Priority: | critical | Milestone: | undecided |
| Version: | master | Keywords: | git |
| Cc: |
Description
When buildbot updates a repository using Git, one of the things it does is:
$ git branch -M <branch-name>
where <branch-name> is the target branch. Even if the branch already existed, this worked fine...
...up until Git 1.7.7, which for some reason changed this. Now when you try to rename the current branch, git branch -M throws this error:
fatal: Cannot force update the current branch.
Unless this bug is fixed, IT WILL NOT BE POSSIBLE TO USE BUILDBOT WITH GIT >= 1.7.7. Luckily for you all, I went ahead and fixed this for you. (Watch for an upcoming pull request.)
Attachments
Change History
comment:2 Changed 20 months ago by mattock
I backported this patch to buildbot 0.7.12 manually, but unfortunately it did not fix the problem. What did seem to fix this was skipping the git branch -M master step conditionally:
def _didFetch(self, res):
if self.revision:
head = self.revision
else:
head = 'FETCH_HEAD'
# That is not sufficient. git will leave unversioned files and empty
# directories. Clean them up manually in _didReset.
command = ['reset', '--hard', head]
if self.branch == "master":
return self._dovccmd(command, self._initSubmodules)
else:
return self._dovccmd(command, self._didHeadCheckout)
Didn't look deep enough in the code to know if this has some unwanted side-effects.
comment:3 Changed 18 months ago by dustin
This was fixed in 6f5ce3b2ab033338f3ad7ddccbf8b6542311f70b.
Changed 16 months ago by mattock
-
attachment
buildbot_ticket_2127.patch
added
Backported fix to buildbot 0.8.5
![[Buildbot Logo]](/chrome/site/header-text-transparent.png)
Fix is merged - thanks for spotting that!