mirror of
https://github.com/hanzoai/dev.git
synced 2026-10-25 03:23:33 +00:00
ci(upstream-merge): handle no merge-base case in context prep (skip reintroduced detection when unrelated histories)
This commit is contained in:
@@ -281,16 +281,20 @@ jobs:
|
||||
git diff --stat "origin/${DEFAULT_BRANCH}..upstream/${UPSTREAM_BRANCH}" > .github/auto/DIFFSTAT.txt || true
|
||||
|
||||
# Detect reintroduced paths: present in merge-base, absent on default, present on upstream
|
||||
MB=$(git merge-base "origin/${DEFAULT_BRANCH}" "upstream/${UPSTREAM_BRANCH}")
|
||||
MB=$(git merge-base "origin/${DEFAULT_BRANCH}" "upstream/${UPSTREAM_BRANCH}" 2>/dev/null || true)
|
||||
: > .github/auto/REINTRODUCED_PATHS.txt
|
||||
while read -r status path; do
|
||||
[ "${status}" = "A" ] || continue
|
||||
if git ls-tree -r --name-only "$MB" -- "$path" >/dev/null 2>&1 && \
|
||||
git ls-tree -r --name-only "$MB" -- "$path" | grep -q . && \
|
||||
! git ls-tree -r --name-only "origin/${DEFAULT_BRANCH}" -- "$path" | grep -q .; then
|
||||
echo "$path" >> .github/auto/REINTRODUCED_PATHS.txt
|
||||
fi
|
||||
done < <(git diff --name-status "origin/${DEFAULT_BRANCH}..upstream/${UPSTREAM_BRANCH}" || true)
|
||||
if [ -n "${MB:-}" ]; then
|
||||
while read -r status path; do
|
||||
[ "${status}" = "A" ] || continue
|
||||
if git ls-tree -r --name-only "$MB" -- "$path" >/dev/null 2>&1 && \
|
||||
git ls-tree -r --name-only "$MB" -- "$path" | grep -q . && \
|
||||
! git ls-tree -r --name-only "origin/${DEFAULT_BRANCH}" -- "$path" | grep -q .; then
|
||||
echo "$path" >> .github/auto/REINTRODUCED_PATHS.txt
|
||||
fi
|
||||
done < <(git diff --name-status "origin/${DEFAULT_BRANCH}..upstream/${UPSTREAM_BRANCH}" || true)
|
||||
else
|
||||
echo "No merge-base between origin/${DEFAULT_BRANCH} and upstream/${UPSTREAM_BRANCH}; skipping reintroduced path detection." >> .github/auto/CHANGE_HISTOGRAM.txt
|
||||
fi
|
||||
|
||||
- name: Run Code agent to perform upstream merge
|
||||
id: agent
|
||||
|
||||
Reference in New Issue
Block a user