2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-14 17:24:04 +00:00

assume about HEAD no more

This commit is contained in:
Pratik Vyas 2014-10-30 12:38:02 +05:30
parent 36338974cc
commit bcd3a6de48

View File

@ -1,5 +1,5 @@
import os import os
from .utils import exec_cmd, get_frappe, check_git_for_shallow_clone, get_config, build_assets, restart_supervisor_processes from .utils import exec_cmd, get_frappe, check_git_for_shallow_clone, get_config, build_assets, restart_supervisor_processes, get_cmd_output
import logging import logging
import requests import requests
@ -61,7 +61,10 @@ def pull_all_apps(bench='.'):
app_dir = os.path.join(apps_dir, app) app_dir = os.path.join(apps_dir, app)
if os.path.exists(os.path.join(app_dir, '.git')): if os.path.exists(os.path.join(app_dir, '.git')):
logger.info('pulling {0}'.format(app)) logger.info('pulling {0}'.format(app))
exec_cmd("git pull {rebase} upstream HEAD".format(rebase=rebase), cwd=app_dir) exec_cmd("git pull {rebase} upstream {branch}".format(rebase=rebase, branch=get_current_branch(app_dir)), cwd=app_dir)
def get_current_branch(repo_dir):
return get_cmd_output("basename $(git symbolic-ref -q HEAD)", cwd=repo_dir)
def install_apps_from_path(path, bench='.'): def install_apps_from_path(path, bench='.'):
apps = get_apps_json(path) apps = get_apps_json(path)