Change: rules_git_checkout handling branch names with slashes & Remote HEAD. (#944)
* Add: Test for branch names with slashes & Remote HEAD. * - Add: Handling for removing remote HEAD. - Change: Improved handling for branches with slash in their names.
This commit is contained in:
@@ -18,10 +18,12 @@ def get_branches():
|
||||
stdout=subprocess.PIPE)
|
||||
for line in proc.stdout.readlines():
|
||||
line = line.decode('utf-8')
|
||||
if '->' in line: # Remote HEAD like b' remotes/origin/HEAD -> origin/master'
|
||||
continue
|
||||
if line.startswith('*'):
|
||||
line = line.split(' ')[1]
|
||||
if '/' in line:
|
||||
line = line.split('/')[-1]
|
||||
if line.strip().startswith('remotes/'):
|
||||
line = '/'.join(line.split('/')[2:])
|
||||
yield line.strip()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user