On the branch items (to become version 0.2.0), the Git HEAD is retrieved using the Gitsigns provided buf-local var gitsigns_head. This introduces an issue which is a regression. The original problem is described here: #2 (comment)
Thanks for this. At first glance, this is now working as expected when I've got a file loaded that's managed as part of the detached worktree. However, there seems to be a negative side-effect of the logic since the git info is also displayed when running Neovim from a directory that is not part of the worktree. In other words, let's say we're in ~/projects/foobar which isn't even a git repo and run nvim baz.txt, I wouldn't expect to see the git bits. If I read the logic from above correctly, the file loaded in the buffer (hopefully the complete path) would need to be managed in the detached worktree in order to qualify. Maybe that test isn't in place?
Steps to reproduce
- Bare repo
~/path/to/some/bare-repo.git exists with status.showUntrackedFiles set to false.
- Gitsigns config with this worktree:
worktrees = {
{
toplevel = vim.env.HOME,
gitdir = vim.env.HOME .. "/path/to/some/bare-repo.git"
}
}
- Open a file not managed by the repo, e.g., in my machine that can be
~/dev/temp/_.lua.
Actual behavior
The Git HEAD is displayed by Bareline.
Expected behavior
The Git HEAD is not displayed by Bareline, since the bare repo has status.showUntrackedFiles set to false.
Notes
- A text search in the Gitsigns repo shows no matches for
showUntrackedFiles.
On the branch
items(to become version 0.2.0), the Git HEAD is retrieved using the Gitsigns provided buf-local vargitsigns_head. This introduces an issue which is a regression. The original problem is described here: #2 (comment)Steps to reproduce
~/path/to/some/bare-repo.gitexists withstatus.showUntrackedFilesset tofalse.~/dev/temp/_.lua.Actual behavior
The Git HEAD is displayed by Bareline.
Expected behavior
The Git HEAD is not displayed by Bareline, since the bare repo has
status.showUntrackedFilesset tofalse.Notes
showUntrackedFiles.