Skip to content

Commit 9112049

Browse files
committed
chore(sync): auto-resolve upstream-preferred conflicts
1 parent b520c02 commit 9112049

1 file changed

Lines changed: 25 additions & 1 deletion

File tree

sync-upstream.sh

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,45 @@ FORK_OWNED_PATHS=(
2222
"CLAUDE.md"
2323
)
2424

25+
# Upstream-owned files that may conflict because equivalent upstream commits were
26+
# previously imported into the fork with different commit ancestry. In these
27+
# cases we want the exact upstream version during sync.
28+
UPSTREAM_PREFERRED_PATHS=(
29+
"engine/src/main/java/com/arcadedb/utility/RidHashSet.java"
30+
)
31+
2532
PROTECTED_SOURCE_REV=""
2633

2734
try_auto_resolve() {
28-
local conflicts resolved
35+
local conflicts resolved path handled
2936
conflicts=$(git status --porcelain | awk '$1 ~ /U/ {print $2}')
3037
if [ -z "$conflicts" ]; then
3138
return 1
3239
fi
3340
resolved=0
3441
for path in $conflicts; do
42+
handled=0
3543
for protected_path in "${FORK_OWNED_PATHS[@]}"; do
3644
if [[ "$path" == "$protected_path" ]]; then
3745
git checkout --ours -- "$path"
3846
git add "$path"
3947
resolved=1
48+
handled=1
49+
break
50+
fi
51+
done
52+
53+
if [ "$handled" -eq 1 ]; then
54+
continue
55+
fi
56+
57+
for upstream_path in "${UPSTREAM_PREFERRED_PATHS[@]}"; do
58+
if [[ "$path" == "$upstream_path" ]]; then
59+
echo -e "${CYAN}ℹ️ Auto-resolving upstream-preferred conflict: $path${NC}"
60+
git checkout --theirs -- "$path"
61+
git add "$path"
62+
resolved=1
63+
handled=1
4064
break
4165
fi
4266
done

0 commit comments

Comments
 (0)