Conversation
Only delete local git branches that were explicitly checked out during script execution rather than deleting all local branches.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
🎯 What
Fixes the cleanup logic in
script.ps1to track branches checked out during PR resolution and only delete those branches instead of deleting all local branches indiscriminately.💡 Why
The previous logic iterated through
git branchand deleted all local branches except the base branch. This posed a risk of deleting user's un-related local branches that existed before running the script. By tracking checked out branches in aHashSet[string], the script now selectively cleans up only the PR branches it explicitly checked out.✅ Verification
pwsh.script.ps1against a temporary Git repo with a mockghCLI. Confirmed that PR branches checked out during resolution were cleaned up while other local branches were preserved.✨ Result
Local branch cleanup is now safe and targeted to only script-created/checked-out PR branches.
PR created automatically by Jules for task 1244228609587489830 started by @Cylae