Fixed branch checking

This commit is contained in:
Anton Hvornum 2019-11-13 22:51:16 +00:00
parent 010e931aeb
commit 211fdee511
1 changed files with 2 additions and 2 deletions

View File

@ -336,8 +336,8 @@ def update_git(branch='master'):
# if(num_changes):
if branch != 'master':
on_branch = simple_command('(cd /root/archinstall; git branch | grep "*" | cut -d\' \' -f 2)')
if on_branch.strip().lower() != branch.strip().lower():
on_branch = simple_command('(cd /root/archinstall; git branch | grep "*" | cut -d\' \' -f 2)').decode('UTF-8').strip()
if on_branch.lower() != branch.lower():
print(f'[N] Changing branch from {on_branch} to {branch}')
output = simple_command(f'(cd /root/archinstall; git checkout {branch}; git pull)')
print('[N] Rebooting the new branch')