Auto-restore local start.sh changes before git pull

This commit is contained in:
J0Z1L 2026-02-27 23:58:44 +01:00
parent 111c181e3a
commit b3a343c3a0

View file

@ -41,6 +41,14 @@ if [[ "${START_BOOTSTRAPPED:-0}" != "1" ]]; then
if [[ -d "${INSTALL_DIR}/.git" ]]; then if [[ -d "${INSTALL_DIR}/.git" ]]; then
echo "==> Repo vorhanden, aktualisiere: ${INSTALL_DIR}" echo "==> Repo vorhanden, aktualisiere: ${INSTALL_DIR}"
if [[ "${SKIP_GIT_PULL:-0}" != "1" ]]; then if [[ "${SKIP_GIT_PULL:-0}" != "1" ]]; then
START_FILE_REL="$(basename "$0")"
if git -C "${INSTALL_DIR}" diff --quiet -- "${START_FILE_REL}"; then
:
else
echo "==> Lokale Aenderung an ${START_FILE_REL} erkannt, setze Datei fuer Update zurueck"
git -C "${INSTALL_DIR}" restore -- "${START_FILE_REL}" || true
fi
git -C "${INSTALL_DIR}" fetch --prune origin git -C "${INSTALL_DIR}" fetch --prune origin
git -C "${INSTALL_DIR}" checkout "${REPO_BRANCH}" git -C "${INSTALL_DIR}" checkout "${REPO_BRANCH}"
git -C "${INSTALL_DIR}" pull --ff-only origin "${REPO_BRANCH}" git -C "${INSTALL_DIR}" pull --ff-only origin "${REPO_BRANCH}"