Fix sync-vps-repos.sh to unconditionally reset and checkout README.md (handling both staged and unstaged README modifications)
This commit is contained in:
1 parent
234ddcbb9b
commit
bacaa9d09c
2 files changed
+3
-4
No files matched your search
@@ -114,9 +114,8 @@ if [[ "${DO_PULL}" -eq 1 ]]; then
|
||||
echo "[1/5] Updating ${REPOS_ROOT}/${repo} (${remote_name}/${branch})..."
|
||||
prev_head="$(git -C "${REPOS_ROOT}/${repo}" rev-parse HEAD)"
|
||||
run_checked "git fetch ${repo}" git -C "${REPOS_ROOT}/${repo}" fetch --force "${remote_name}" "${branch}" --tags
|
||||
if ! git -C "${REPOS_ROOT}/${repo}" diff --quiet -- README.md 2>&1; then
|
||||
git -C "${REPOS_ROOT}/${repo}" checkout -- README.md || true
|
||||
fi
|
||||
git -C "${REPOS_ROOT}/${repo}" reset HEAD -- README.md || true
|
||||
git -C "${REPOS_ROOT}/${repo}" checkout -- README.md || true
|
||||
if [[ -n "$(git -C "${REPOS_ROOT}/${repo}" ls-files financial-aq-harvest-latest.json)" ]]; then
|
||||
if ! git -C "${REPOS_ROOT}/${repo}" diff --quiet -- financial-aq-harvest-latest.json 2>&1; then
|
||||
git -C "${REPOS_ROOT}/${repo}" checkout -- financial-aq-harvest-latest.json || true
|
||||
|
||||
Reference in new issue
Block a user