mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
Merge "Fix prune when bare git has detached head"
This commit is contained in:
commit
985ac6b946
@ -1583,8 +1583,6 @@ class Project(object):
|
|||||||
|
|
||||||
if kill:
|
if kill:
|
||||||
old = self.bare_git.GetHead()
|
old = self.bare_git.GetHead()
|
||||||
if old is None:
|
|
||||||
old = 'refs/heads/please_never_use_this_as_a_branch_name'
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.bare_git.DetachHead(rev)
|
self.bare_git.DetachHead(rev)
|
||||||
@ -1596,6 +1594,9 @@ class Project(object):
|
|||||||
capture_stderr=True)
|
capture_stderr=True)
|
||||||
b.Wait()
|
b.Wait()
|
||||||
finally:
|
finally:
|
||||||
|
if ID_RE.match(old):
|
||||||
|
self.bare_git.DetachHead(old)
|
||||||
|
else:
|
||||||
self.bare_git.SetHead(old)
|
self.bare_git.SetHead(old)
|
||||||
left = self._allrefs
|
left = self._allrefs
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user