pwntester / octo.nvim

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

Error execute vim.schedule: `attempt to index field defaultBranchRef` when do `octo repo list`, picker fzf-lua #519

Closed MadKuntilanak closed 3 months ago

MadKuntilanak commented 3 months ago

Issue Description

Type: bug report

Describe what happened

Error when do :Octo repo list with picker fzf-lua (but okay with telescope)

Error executing vim.schedule lua callback: ....local/share/nvim/lazy/octo.nvim/lua/octo/ui/writers.lua:89: attempt to index field 'defaultBranchRef' (a userdata value)
stack traceback:
    ....local/share/nvim/lazy/octo.nvim/lua/octo/ui/writers.lua:89: in function 'write_repo'
    ...share/nvim/lazy/octo.nvim/lua/octo/model/octo-buffer.lua:89: in function 'render_repo'
    ...m/lazy/octo.nvim/lua/octo/pickers/fzf-lua/previewers.lua:318: in function 'cb'
    ...0x/.local/share/nvim/lazy/octo.nvim/lua/octo/gh/init.lua:160: in function ''
    vim/_editor.lua: in function <vim/_editor.lua:0>

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

  1. :Octo repo list
  2. Error

Tell us your environment

nvim nightly latest

milogert commented 3 months ago

I think the problem is that you have a repository that doesn't have any default branch set. I'll work on fixing this though, thanks!