Skip to content

Commit

Permalink
fix: only get the specific branch for version check
Browse files Browse the repository at this point in the history
  • Loading branch information
casesolved-co-uk committed Mar 17, 2021
1 parent 895c403 commit 0ff8ddd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bench/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,13 +345,14 @@ def get_develop_version(app, bench_path='.'):

def get_upstream_version(app, branch=None, bench_path='.'):
repo_dir = get_repo_dir(app, bench_path=bench_path)
if not branch:
branch = get_current_branch(app, bench_path=bench_path)

try:
subprocess.call('git fetch --depth=1 --no-tags upstream', shell=True, cwd=repo_dir)
subprocess.call('git fetch --depth=1 --no-tags upstream {branch}'.format(branch=branch), shell=True, cwd=repo_dir)
except CommandFailedError:
raise InvalidRemoteException('Failed to fetch from remote named upstream for {0}'.format(app))

if not branch:
branch = get_current_branch(app, bench_path=bench_path)
try:
contents = subprocess.check_output('git show upstream/{branch}:{app}/__init__.py'.format(branch=branch, app=app),
shell=True, cwd=repo_dir, stderr=subprocess.STDOUT)
Expand Down

0 comments on commit 0ff8ddd

Please sign in to comment.