maybe fixed now with three way merge (again)
All checks were successful
Update Child Repos / update (push) Successful in 6s

This commit is contained in:
2026-01-02 12:50:15 +01:00
parent 3f888d156c
commit 055aa7a941

View File

@@ -106,8 +106,34 @@ while IFS= read -r clone_url; do
continue continue
fi fi
file_diff=$(git diff "${PREVIOUS_COMMIT_ID}" "${CURRENT_COMMIT_ID}" -- "${file}" 2>/dev/null || true)
if [ -n "${file_diff}" ]; then
tmp_current=$(mktemp)
tmp_diff=$(mktemp)
echo "${current_content}" > "${tmp_current}"
echo "${file_diff}" > "${tmp_diff}"
if patch --dry-run "${tmp_current}" "${tmp_diff}" >/dev/null 2>&1; then
patch "${tmp_current}" "${tmp_diff}" >/dev/null 2>&1
patched_content=$(cat "${tmp_current}")
if [ "${current_content}" != "${patched_content}" ]; then
echo "${patched_content}" > "${file}"
git add "${file}"
files_changed=true
echo "Merged updates for ${file} in ${repo_name}"
fi
else
echo "Merge conflict detected in ${repo_name}:${file} - preserving local changes"
conflicted_files+=("${file}")
fi
rm -f "${tmp_current}" "${tmp_diff}"
else
echo "File ${file} has local changes in ${repo_name} - preserving local changes" echo "File ${file} has local changes in ${repo_name} - preserving local changes"
conflicted_files+=("${file}") conflicted_files+=("${file}")
fi
else else
echo "Adding new file ${file} from template to ${repo_name}" echo "Adding new file ${file} from template to ${repo_name}"
mkdir -p "$(dirname "${file}")" mkdir -p "$(dirname "${file}")"