mirror of
https://github.com/frappe/bench.git
synced 2025-01-10 09:02:10 +00:00
feat: Keep repos shallow if --reset is specified and shallow_clone is set
This commit is contained in:
parent
8a7a532a45
commit
66240e1f8d
12
bench/app.py
12
bench/app.py
@ -268,9 +268,15 @@ Here are your choices:
|
||||
continue
|
||||
logger.log('pulling {0}'.format(app))
|
||||
if reset:
|
||||
exec_cmd("git fetch --all", cwd=app_dir)
|
||||
exec_cmd("git reset --hard {remote}/{branch}".format(
|
||||
remote=remote, branch=get_current_branch(app,bench_path=bench_path)), cwd=app_dir)
|
||||
reset_cmd = "git reset --hard {remote}/{branch}".format(
|
||||
remote=remote, branch=get_current_branch(app,bench_path=bench_path))
|
||||
if get_config(bench_path).get('shallow_clone'):
|
||||
exec_cmd("git fetch --depth 1 --no-tags", cwd=app_dir)
|
||||
exec_cmd(reset_cmd, cwd=app_dir)
|
||||
exec_cmd("git clean -dfx", cwd=app_dir)
|
||||
else:
|
||||
exec_cmd("git fetch --all", cwd=app_dir)
|
||||
exec_cmd(reset_cmd, cwd=app_dir)
|
||||
else:
|
||||
exec_cmd("git pull {rebase} {remote} {branch}".format(rebase=rebase,
|
||||
remote=remote, branch=get_current_branch(app, bench_path=bench_path)), cwd=app_dir)
|
||||
|
Loading…
Reference in New Issue
Block a user