mirror of
https://github.com/frappe/bench.git
synced 2025-01-10 09:02:10 +00:00
fix: Unshallow clone if update without --reset
If an unshallow clone has to be updated, the only way to update it without a reset will require an unshallow. This is because there may be uncommitted or committed changes in any of the apps, although unfavoured should be handled safely. The only way to update such repos is via the user configured settings..or a ff only merge.
This commit is contained in:
parent
70c9c17f63
commit
4cadf2c719
@ -272,6 +272,14 @@ Here are your choices:
|
||||
add_to_excluded_apps_txt(app, bench_path=bench_path)
|
||||
print("Skipping pull for app {}, since remote doesn't exist, and adding it to excluded apps".format(app))
|
||||
continue
|
||||
|
||||
if not get_config(bench_path).get('shallow_clone') or not reset:
|
||||
is_shallow = os.path.exists(os.path.join(app_dir, ".git", "shallow"))
|
||||
if is_shallow:
|
||||
s = " to safely pull remote changes." if not reset else ""
|
||||
print(f"Unshallowing {app}{s}")
|
||||
exec_cmd(f"git fetch {remote} --unshallow", cwd=app_dir)
|
||||
|
||||
branch = get_current_branch(app, bench_path=bench_path)
|
||||
logger.log('pulling {0}'.format(app))
|
||||
if reset:
|
||||
|
Loading…
Reference in New Issue
Block a user