Merge "Fix prune when bare git has detached head"

This commit is contained in:
Dan Willemsen 2016-02-04 22:44:19 +00:00 committed by Gerrit Code Review
commit 985ac6b946

View File

@ -1583,8 +1583,6 @@ class Project(object):
if kill:
old = self.bare_git.GetHead()
if old is None:
old = 'refs/heads/please_never_use_this_as_a_branch_name'
try:
self.bare_git.DetachHead(rev)
@ -1596,6 +1594,9 @@ class Project(object):
capture_stderr=True)
b.Wait()
finally:
if ID_RE.match(old):
self.bare_git.DetachHead(old)
else:
self.bare_git.SetHead(old)
left = self._allrefs