mirror of
https://github.com/Prowlarr/Indexers.git
synced 2025-12-26 14:09:27 +00:00
Fixed: ensure branch starts from latest upstream to prevent push conflicts
This commit is contained in:
@@ -435,11 +435,15 @@ git_branch_reset() {
|
|||||||
log "DEBUG" "Development Mode - Skipping reset to [$prowlarr_remote_name/$prowlarr_target_branch]"
|
log "DEBUG" "Development Mode - Skipping reset to [$prowlarr_remote_name/$prowlarr_target_branch]"
|
||||||
else
|
else
|
||||||
git reset --hard "$prowlarr_remote_name"/"$prowlarr_target_branch"
|
git reset --hard "$prowlarr_remote_name"/"$prowlarr_target_branch"
|
||||||
log "INFO" "local [$prowlarr_target_branch] hard reset based on [$prowlarr_remote_name/$PROWLARR_RELEASE_BRANCH]"
|
git pull "$prowlarr_remote_name" "$prowlarr_target_branch" --rebase
|
||||||
|
log "INFO" "local [$prowlarr_target_branch] reset and rebased on latest upstream"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
git checkout -B "$prowlarr_target_branch" "$prowlarr_remote_name"/"$prowlarr_target_branch"
|
git checkout -B "$prowlarr_target_branch" "$prowlarr_remote_name"/"$prowlarr_target_branch"
|
||||||
log "INFO" "local [$prowlarr_target_branch] created from [$prowlarr_remote_name/$prowlarr_target_branch]"
|
log "INFO" "local [$prowlarr_target_branch] created from [$prowlarr_remote_name/$prowlarr_target_branch]"
|
||||||
|
# Ensure we have the latest changes by rebasing on upstream
|
||||||
|
git pull "$prowlarr_remote_name" "$prowlarr_target_branch" --rebase
|
||||||
|
log "INFO" "rebased [$prowlarr_target_branch] on latest upstream"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -1015,19 +1019,8 @@ push_changes() {
|
|||||||
if git push "$prowlarr_push_remote" "$push_branch" --force-if-includes; then
|
if git push "$prowlarr_push_remote" "$push_branch" --force-if-includes; then
|
||||||
log "SUCCESS" "[$prowlarr_push_remote $push_branch] Branch Pushed"
|
log "SUCCESS" "[$prowlarr_push_remote $push_branch] Branch Pushed"
|
||||||
else
|
else
|
||||||
log "WARN" "Push failed, attempting to pull and retry..."
|
log "ERROR" "Failed to push to [$prowlarr_push_remote $push_branch]"
|
||||||
if git pull "$prowlarr_push_remote" "$push_branch" --rebase; then
|
exit 8
|
||||||
log "INFO" "Successfully pulled changes, retrying push..."
|
|
||||||
if git push "$prowlarr_push_remote" "$push_branch" --force-if-includes; then
|
|
||||||
log "SUCCESS" "[$prowlarr_push_remote $push_branch] Branch Pushed after pull"
|
|
||||||
else
|
|
||||||
log "ERROR" "Failed to push to [$prowlarr_push_remote $push_branch] after pull"
|
|
||||||
exit 8
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
log "ERROR" "Failed to pull from [$prowlarr_push_remote $push_branch] and push failed"
|
|
||||||
exit 8
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
log "SUCCESS" "Skipping Push to [$prowlarr_push_remote/$push_branch] you should consider pushing manually and/or submitting a pull-request."
|
log "SUCCESS" "Skipping Push to [$prowlarr_push_remote/$push_branch] you should consider pushing manually and/or submitting a pull-request."
|
||||||
|
|||||||
Reference in New Issue
Block a user