Skip to content

🧹 Fix indiscriminate branch deletion in cleanup logic - #68

Open
Cylae wants to merge 1 commit into
mainfrom
fix/selective-branch-deletion-1244228609587489830
Open

Cylae wants to merge 1 commit into
mainfrom
fix/selective-branch-deletion-1244228609587489830

Conversation

@Cylae

@Cylae Cylae commented Sep 1, 2026

Copy link
Copy Markdown
Owner

🎯 What

Fixes the cleanup logic in script.ps1 to 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 branch and 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 a HashSet[string], the script now selectively cleans up only the PR branches it explicitly checked out.

✅ Verification

  • Checked script syntax with pwsh.
  • Executed script.ps1 against a temporary Git repo with a mock gh CLI. Confirmed that PR branches checked out during resolution were cleaned up while other local branches were preserved.
  • Code review requested and approved.

✨ 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

Only delete local git branches that were explicitly checked out during
script execution rather than deleting all local branches.
@google-labs-jules

Copy link
Copy Markdown

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant