Skip to content

fix(git_status): Fix worktree not found when use_file_path=true#3412

Closed
P4Cu wants to merge 2 commits intonvim-telescope:masterfrom
P4Cu:fix/git_status_for_worktree_use_file_path_true
Closed

fix(git_status): Fix worktree not found when use_file_path=true#3412
P4Cu wants to merge 2 commits intonvim-telescope:masterfrom
P4Cu:fix/git_status_for_worktree_use_file_path_true

Conversation

@P4Cu
Copy link
Copy Markdown

@P4Cu P4Cu commented Feb 12, 2025

Description

:lua require("telescope.builtin").git_status { use_file_path = true } fails when called from worktree.
This happens because we're looking for .git directory while for worktrees it's a .git file.
I propose a better solution which use git rev-parse --show-toplevel that will work regardless of git internals (similar approach already used in another part of code).

Fixes #3409

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

See #3409 for minimal config that reproduces the issue.

I've tested it on non-worktree/worktree/non-git my full config.

Configuration:

NVIM v0.10.2
Build type: Release
LuaJIT 2.1.1713484068
Run "nvim -V1 -v" for more info
  • windows 11 + fedora 47

Checklist:

  • My code follows the style guidelines of this project (stylua)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (lua annotations)

@P4Cu
Copy link
Copy Markdown
Author

P4Cu commented Feb 16, 2025

Close in favor of newer approach using nvim9.0 #3417

@P4Cu P4Cu closed this Feb 16, 2025
@P4Cu P4Cu deleted the fix/git_status_for_worktree_use_file_path_true branch February 16, 2025 11:53
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.

git_status { use_file_path = true } on worktree

1 participant