pwntester / octo.nvim

Edit and review GitHub issues and pull requests from the comfort of your favorite editor
MIT License
2.33k stars 125 forks source link

[Regression] Unable to checkout PR of a fork #279

Closed akinsho closed 2 years ago

akinsho commented 2 years ago

Issue Description

Type: bug report or feature request

Describe what happened (or what feature you want)

Hi @pwntester, so I previously reported this issue in #146, and you kindly fixed it. I've noticed however that this behaviour has regressed and when trying to check out the PR for a fork I get a path not found error. I think it is maybe failing to fetch the PR correctly, however this consistently works using the gh cli which I thought this plugin actually used under the hood.

Describe what you expected to happen

When I run Octo pr list and select the PR from a contributor to one of my repos, it should checkout that PR, so I can review it

How to reproduce it (as minimally and precisely as possible)

This is specific to me as an example

  1. Go to one of my projects in nvim
  2. Run Octo pr list
  3. Press open the PR in octo
  4. Run Octo pr checkout
  5. It doesn't checkout the correct PR sometimes it errors on the path, sometimes it goes to the wrong branch

Tell us your environment

:version                                                                                                                                                                             
NVIM v0.7.0-dev+1406-g8c25dbff4                                                                                                                                                      
Build type: Release                                                                                                                                                                  
LuaJIT 2.1.0-beta3                                                                                                                                                                   
Compiled by akin@Akins-MacBook-Pro.local                                                                                                                                             

Features: +acl +iconv +tui                                                                                                                                                           
See ":help feature-compile"                                                                                                                                                          

   system vimrc file: "$VIM/sysinit.vim"                                                                                                                                             
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/HEAD-8c25dbf/share/nvim"                                                                                                          

Run :checkhealth for more info 

Anything else we need to know?

pwntester commented 2 years ago

Thanks for reporting @akinsho, I was internally using git, I changed to gh in https://github.com/pwntester/octo.nvim/commit/3a75706ec3e915ed11579961886afeed662565a9 can you check if it fixes the issue for you?

akinsho commented 2 years ago

@pwntester thanks for the quick fix, that seems to have resolved the issue 👍🏿. As a very minor point I noticed that it doesn't give feedback when you actually make the change e.g. a notification (via vim.notify) like it does when it errors (this a complete tangent though as the main issued is solved)

pwntester commented 2 years ago

Thanks!, Just improved the message shown after checkout, it should now show whatever branch is active after the checkout