From 26d94c5594b86918eedfe695c769579962b06cb7 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 29 May 2026 17:01:32 +0000 Subject: [PATCH] ci: configure upstream fetch refspec so git fetch creates tracking refs (backport #55422) (#55423) Co-authored-by: Diptanil Saha Co-authored-by: Claude Sonnet 4.6 --- .github/helper/sync_hotfix_translations.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/helper/sync_hotfix_translations.sh b/.github/helper/sync_hotfix_translations.sh index 777d215d933..86f6bb65f6a 100644 --- a/.github/helper/sync_hotfix_translations.sh +++ b/.github/helper/sync_hotfix_translations.sh @@ -22,15 +22,16 @@ cd "./apps/${APP_NAME}" || exit git config user.email "developers@erpnext.com" git config user.name "frappe-pr-bot" git remote set-url upstream "https://github.com/${GITHUB_REPOSITORY}.git" +git config remote.upstream.fetch "+refs/heads/*:refs/remotes/upstream/*" gh auth setup-git git fetch upstream "${HOTFIX_BRANCH}" -if git ls-remote --exit-code --heads upstream sync_translations_${HOTFIX_BRANCH} >/dev/null 2>&1; then - git fetch upstream sync_translations_${HOTFIX_BRANCH} - git checkout -b sync_translations_${HOTFIX_BRANCH} "upstream/sync_translations_${HOTFIX_BRANCH}" +if git ls-remote --exit-code --heads upstream "sync_translations_${HOTFIX_BRANCH}" >/dev/null 2>&1; then + git fetch upstream "sync_translations_${HOTFIX_BRANCH}" + git checkout -b "sync_translations_${HOTFIX_BRANCH}" "upstream/sync_translations_${HOTFIX_BRANCH}" git merge -X theirs "upstream/${HOTFIX_BRANCH}" --no-edit else - git checkout -b sync_translations_${HOTFIX_BRANCH} "upstream/${HOTFIX_BRANCH}" + git checkout -b "sync_translations_${HOTFIX_BRANCH}" "upstream/${HOTFIX_BRANCH}" fi cd ../.. || exit @@ -79,8 +80,8 @@ while IFS= read -r file; do fi done < <(git diff --name-only "${APP_NAME}/locale/" | grep '\.po$' | sort) -if git ls-remote --exit-code --heads upstream sync_translations_${HOTFIX_BRANCH} >/dev/null 2>&1; then - git fetch upstream sync_translations_${HOTFIX_BRANCH} +if git ls-remote --exit-code --heads upstream "sync_translations_${HOTFIX_BRANCH}" >/dev/null 2>&1; then + git fetch upstream "sync_translations_${HOTFIX_BRANCH}" git merge -X ours "upstream/sync_translations_${HOTFIX_BRANCH}" --no-edit fi git push -u upstream sync_translations_${HOTFIX_BRANCH}