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,7 +1594,10 @@ class Project(object):
|
|||||||
capture_stderr=True)
|
capture_stderr=True)
|
||||||
b.Wait()
|
b.Wait()
|
||||||
finally:
|
finally:
|
||||||
self.bare_git.SetHead(old)
|
if ID_RE.match(old):
|
||||||
|
self.bare_git.DetachHead(old)
|
||||||
|
else:
|
||||||
|
self.bare_git.SetHead(old)
|
||||||
left = self._allrefs
|
left = self._allrefs
|
||||||
|
|
||||||
for branch in kill:
|
for branch in kill:
|
||||||
|
Loading…
Reference in New Issue
Block a user