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

added a check for git root query #145

Merged
merged 1 commit into from
Aug 22, 2024
Merged

Conversation

MijikHna
Copy link
Contributor

git -C ... command produces error on my machine if directory is not a git repository and .avante_chat_history/ will be created in fatal: not a git repository folder.

PS: In my opinion this git command call isn't necessary as the local current_dir = fn.fnamemodify(current_file, ":h") already returns the correct working directory.

@MijikHna MijikHna force-pushed the fix/git-root-query branch from ae700da to da494ee Compare August 21, 2024 23:22
@yetone yetone merged commit 480e357 into yetone:main Aug 22, 2024
1 check passed
@bassamsdata
Copy link

I've seen this while updating avante.nvim, so I wanted to mention that there's actually a more performant way to get the Git root of the current file in Neovim v0.10. Since this plugin already requires v0.10, you can use:

vim.fs.root(current_file, { ".git" })

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.

3 participants