From 0ff8dddef960f63e35103285961f08f835da422e Mon Sep 17 00:00:00 2001 From: Richard Case Date: Wed, 10 Mar 2021 19:58:55 +0000 Subject: [PATCH] fix: only get the specific branch for version check --- bench/app.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bench/app.py b/bench/app.py index a2ddfbfa..390ca036 100755 --- a/bench/app.py +++ b/bench/app.py @@ -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)