Fix onboard import cloning from empty new repo instead of archived repo
initial_import() now accepts an optional clone URL override parameter. onboard_flow() passes the archived repo URL so content is cloned from the right source. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -169,6 +169,17 @@ onboard_flow() {
|
||||
local import_prs
|
||||
import_prs=$(echo "$onboard_state" | jq -r '.import_prs // {}')
|
||||
|
||||
# Build the archived repo clone URL for initial_import().
|
||||
# The content lives in the archived repo — the new repo at SUBREPO_URL is empty.
|
||||
local archived_url archived_clone_url
|
||||
archived_url=$(echo "$onboard_state" | jq -r '.archived_url')
|
||||
if [ "${SUBREPO_AUTH:-https}" = "ssh" ]; then
|
||||
archived_clone_url="$archived_url"
|
||||
else
|
||||
# shellcheck disable=SC2001
|
||||
archived_clone_url=$(echo "$archived_url" | sed "s|https://|https://${BOT_USER}:${SUBREPO_TOKEN}@|")
|
||||
fi
|
||||
|
||||
for branch in $branches; do
|
||||
local mapped
|
||||
mapped=$(echo "$target_json" | jq -r --arg b "$branch" '.branches[$b] // empty')
|
||||
@@ -185,7 +196,7 @@ onboard_flow() {
|
||||
|
||||
log "INFO" "Importing branch: ${branch} (subrepo: ${mapped})"
|
||||
local result
|
||||
result=$(initial_import)
|
||||
result=$(initial_import "$archived_clone_url")
|
||||
log "INFO" "Import result for ${branch}: ${result}"
|
||||
|
||||
if [ "$result" = "pr-created" ]; then
|
||||
|
||||
Reference in New Issue
Block a user