Skip to content

Commit

Permalink
Remove hard-coded master branch reference
Browse files Browse the repository at this point in the history
  • Loading branch information
saville committed Dec 13, 2023
1 parent c44b13c commit 7311d56
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pydc_control/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,9 +243,14 @@ def run_checkout(args: argparse.Namespace):
continue

if os.path.exists(project.path):
log.get_logger().info(f'########### {project.name} (pulling changes) ###########')
commands = ['git', 'pull', 'upstream', 'master']
cwd = project.path
head_branch = subprocess.check_output(
['git', 'rev-parse', '--abbrev-ref', 'HEAD'],
encoding='utf8',
cwd=cwd,
).strip()
log.get_logger().info(f'########### {project.name} (pulling changes for {head_branch}) ###########')
commands = ['git', 'pull', 'upstream', head_branch]
else:
log.get_logger().info(f'########### {project.name} (cloning) ###########')
commands = ['git', 'clone', '--origin', 'upstream', project.repository]
Expand Down

0 comments on commit 7311d56

Please sign in to comment.