seachicken / gh-poi

✨ Safely clean up your local branches
https://dev.to/seachicken/safely-clean-up-your-local-branches-9i3
MIT License
642 stars 17 forks source link

Does not work when merging PRs with "Merge pull request" #40

Closed thehedgefrog closed 2 years ago

thehedgefrog commented 2 years ago

I have 18 local branches and 8 remote branches, every single one (except main) having been merged into main via a pull request.

When I run gh poi in the repo, all branches show in Not deleted branches and nothing is deleted.

It is a public organization repo for an organization including only me. I have confirmed all other gh commands and extensions work as designed.

Your Environment

thehedgefrog commented 2 years ago

Update - I have confirmed the same results with a private and public repo under my personal account, ruling out permissions issues with gh.

thehedgefrog commented 2 years ago

Update 2: the Deleted branches section shows the error There are no branches in the current directory.

seachicken commented 2 years ago

Thanks for the report! What you have reported seems to be a normal operating environment, so we will need more information. You may be able to find the cause of the problem by asking us to check if it works in the following normally operating repositories in your environment.

  1. git clone git@github.com:seachicken/can.git
  2. cd can
  3. for branch in $(git branch --all | grep '^\s*remotes' | egrep --invert-match '(:?HEAD|main)$'); do git branch --track "${branch##*/}" "$branch"; done
  4. gh poi
  5. Expected output: image
thehedgefrog commented 2 years ago

So this test worked fine and I got the expected output per your screenshot.

I tried a test on my own and it still doesn't work. You can clone and test my repo: thehedgefrog/poi-test

seachicken commented 2 years ago

It seems to not work well when merging PRs with "Merge pull request". I will fix this.

image
seachicken commented 2 years ago

Thanks for the great report! I believe it has been fixed and will be released soon

image