[Fix] Scope worktree PR lookup to user branches#71
Conversation
Signed-off-by: samzong <samzong.lu@gmail.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 642f734082
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if branch == "" { | ||
| return false | ||
| } | ||
| _, err := c.runner.Run("-C", c.repoDir, "show-ref", "--verify", "--quiet", "refs/remotes/origin/"+branch) |
There was a problem hiding this comment.
Respect non-origin remotes when filtering pushed branches
In repositories whose review remote is not named origin—for example a single GitHub/GitLab remote named upstream or github—this hard-coded refs/remotes/origin/<branch> check makes every worktree look unpushed, so ReviewStates returns before calling detectReviewRemote/the CLI and gmc wt --pr silently shows no PR/MR data. Since reviewRemoteCandidates already supports upstream and a single arbitrary remote, the pushed-branch check should use the selected review remote (or otherwise consider non-origin remotes) rather than only origin.
Useful? React with 👍 / 👎.
What's changed?
gmc wt --prreview lookup to the current user's pushed worktree branches.Why
wt --prruns should avoid unnecessary GitHub/GitLab calls while keeping local worktree state fresh.