mirror of
https://github.com/frappe/bench.git
synced 2025-01-10 09:02:10 +00:00
fix: only get the specific branch for version check
This commit is contained in:
parent
895c403278
commit
0ff8dddef9
@ -345,13 +345,14 @@ def get_develop_version(app, bench_path='.'):
|
|||||||
|
|
||||||
def get_upstream_version(app, branch=None, bench_path='.'):
|
def get_upstream_version(app, branch=None, bench_path='.'):
|
||||||
repo_dir = get_repo_dir(app, bench_path=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:
|
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:
|
except CommandFailedError:
|
||||||
raise InvalidRemoteException('Failed to fetch from remote named upstream for {0}'.format(app))
|
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:
|
try:
|
||||||
contents = subprocess.check_output('git show upstream/{branch}:{app}/__init__.py'.format(branch=branch, app=app),
|
contents = subprocess.check_output('git show upstream/{branch}:{app}/__init__.py'.format(branch=branch, app=app),
|
||||||
shell=True, cwd=repo_dir, stderr=subprocess.STDOUT)
|
shell=True, cwd=repo_dir, stderr=subprocess.STDOUT)
|
||||||
|
Loading…
Reference in New Issue
Block a user