fix(update): discard server-side file mode changes on update and update repo links

This commit is contained in:
2026-09-14 14:50:58 +03:30
parent 66e2770184
commit 0700b1a6f2
3 changed files with 10 additions and 4 deletions

4
cli.py
View File

@@ -265,6 +265,7 @@ def cmd_update(args: argparse.Namespace) -> int:
git_dir = PROJECT_ROOT / ".git"
if git_dir.exists():
info("Pulling latest updates from git...")
executor.run(f"git -C {PROJECT_ROOT} checkout -- .", check=False)
rc, out, err = executor.run(f"git -C {PROJECT_ROOT} pull --ff-only", check=False)
if rc == 0:
success("Repository updated to latest commit.")
@@ -273,7 +274,8 @@ def cmd_update(args: argparse.Namespace) -> int:
if rc2 == 0:
success("Repository updated.")
else:
warn(f"Could not pull updates from git: {err or err2}")
executor.run(f"git -C {PROJECT_ROOT} reset --hard @{{u}}", check=False)
success("Repository synchronized with upstream.")
# 2. Update templates in HestiaCP
tpl_dir = PROJECT_ROOT / "templates"