You've already forked go-template-container-webserver
maybe fixed now with three way merge (again)
All checks were successful
Update Child Repos / update (push) Successful in 6s
All checks were successful
Update Child Repos / update (push) Successful in 6s
This commit is contained in:
@@ -106,8 +106,34 @@ while IFS= read -r clone_url; do
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "File ${file} has local changes in ${repo_name} - preserving local changes"
|
file_diff=$(git diff "${PREVIOUS_COMMIT_ID}" "${CURRENT_COMMIT_ID}" -- "${file}" 2>/dev/null || true)
|
||||||
conflicted_files+=("${file}")
|
|
||||||
|
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"
|
||||||
|
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}")"
|
||||||
|
|||||||
Reference in New Issue
Block a user