mirror of
https://github.com/xcp-ng/xcp.git
synced 2026-12-05 01:48:07 +00:00
build_koji: don't break when starting on a detached head
Signed-off-by: Yann Dirson <yann.dirson@vates.tech>
This commit is contained in:
1 parent
673284aa50
commit
d981b4acde
1 file changed
+2
-1
@@ -90,7 +90,8 @@ def local_branch(branch):
|
||||
try:
|
||||
yield branch
|
||||
finally:
|
||||
subprocess.check_call(['git', 'checkout', prev_branch])
|
||||
# prev_branch is empty when the head was detached
|
||||
subprocess.check_call(['git', 'checkout', prev_branch or commit])
|
||||
|
||||
def is_old_branch(b):
|
||||
branch_time = datetime.strptime(b.split('/')[-1], TIME_FORMAT)
|
||||
|
||||
Reference in new issue
Block a user