Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(git show): allow cwd outside root git dir #334

Merged
merged 1 commit into from
Mar 15, 2023

Conversation

zdleaf
Copy link
Contributor

@zdleaf zdleaf commented Mar 13, 2023

Hi tanvirtin,

When cwd is outside of the root git directory, calls to git show fail due to the ./ prefix added to the filename. I believe this is not required, since we should be using a relative filename from the project git root dir and/or setting -C to self.cwd.

To replicate, open any file in a root git directory, :cd to some other dir and :VGit buffer_blame_preview

...ocal/share/nvim/plugged/vgit.nvim/lua/vgit/core/loop.lua:43: coroutine failed :: function: 0x7f583cfe90f8                                                                                                                                                   
stack traceback:                                                                                                                                                                                                                                               
        [C]: in function 'on_exit'                                                                                                                                                                                                                             
        ...hare/nvim/plugged/vgit.nvim/lua/vgit/core/ReadStream.lua:79: in function <...hare/nvim/plugged/vgit.nvim/lua/vgit/core/ReadStream.lua:63>                                                                                                           
stack traceback:                                                                                                                                                                                                                                               
        [C]: in function 'resume_coroutine'                                                                                                                                                                                                                    
        ...ocal/share/nvim/plugged/vgit.nvim/lua/vgit/core/loop.lua:43: in function <...ocal/share/nvim/plugged/vgit.nvim/lua/vgit/core/loop.lua:22>

Related to #79

When cwd is outside of the root git directory, calls to git show fail
due to the './' prefix added to the filename. This is not required,
since we should be using a relative filename from the project git root
dir and/or setting -C self.cwd.
@tanvirtin tanvirtin merged commit f8ef9c8 into tanvirtin:main Mar 15, 2023
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.

None yet

2 participants