@@ -10,6 +10,32 @@ DEV_REF="origin/dev"
1010
1111git fetch origin main dev --tags
1212
13+ release_only_path () {
14+ local path=" ${1:- } "
15+ case " ${path} " in
16+ folderview.plus.plg|archive/folderview.plus-* .txz|archive/folderview.plus-* .txz.sha256)
17+ return 0
18+ ;;
19+ * )
20+ return 1
21+ ;;
22+ esac
23+ }
24+
25+ main_differs_from_dev_only_by_release_artifacts () {
26+ local path=" "
27+ mapfile -t DIFF_PATHS < <( git diff --name-only " ${DEV_REF} ..${MAIN_REF} " || true)
28+ if [ " ${# DIFF_PATHS[@]} " -eq 0 ]; then
29+ return 1
30+ fi
31+ for path in " ${DIFF_PATHS[@]} " ; do
32+ if ! release_only_path " ${path} " ; then
33+ return 1
34+ fi
35+ done
36+ return 0
37+ }
38+
1339if git show-ref --verify --quiet " refs/heads/${DEV_BRANCH} " ; then
1440 git checkout " ${DEV_BRANCH} "
1541else
@@ -21,6 +47,11 @@ if git merge-base --is-ancestor "${MAIN_REF}" "${DEV_BRANCH}"; then
2147 exit 0
2248fi
2349
50+ if main_differs_from_dev_only_by_release_artifacts; then
51+ echo " Main differs from dev only by release artifacts/manifest. Skipping back-merge."
52+ exit 0
53+ fi
54+
2455MERGED_CLEANLY=1
2556if ! git merge --no-ff --no-commit " ${MAIN_REF} " ; then
2657 MERGED_CLEANLY=0
@@ -35,21 +66,15 @@ if [ "${MERGED_CLEANLY}" -eq 0 ]; then
3566 fi
3667
3768 for FILE in " ${CONFLICTS[@]} " ; do
38- case " ${FILE} " in
39- folderview.plus.plg|archive/folderview.plus-* .txz|archive/folderview.plus-* .txz.sha256)
40- ;;
41- * )
42- echo " Unexpected merge conflict in ${FILE} ; aborting auto back-merge." >&2
43- git merge --abort
44- exit 1
45- ;;
46- esac
69+ if ! release_only_path " ${FILE} " ; then
70+ echo " Unexpected merge conflict in ${FILE} ; aborting auto back-merge." >&2
71+ git merge --abort
72+ exit 1
73+ fi
4774 done
4875
49- for FILE in " ${CONFLICTS[@]} " ; do
50- git checkout --ours -- " ${FILE} "
51- git add " ${FILE} "
52- done
76+ git checkout HEAD -- archive folderview.plus.plg
77+ git add archive folderview.plus.plg
5378fi
5479
5580# Always force dev channel URLs in case main touched these lines without conflicts.
@@ -67,4 +92,3 @@ if git rev-parse -q --verify MERGE_HEAD >/dev/null; then
6792else
6893 echo " No merge head present; nothing to commit."
6994fi
70-
0 commit comments