Skip to content

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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

P4Cu
Copy link

@P4Cu P4Cu commented Feb 16, 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)

@amplexus
Copy link

amplexus commented Apr 5, 2025

Any reason this PR can't be merged? I'm impacted by this for the same reason as OP in #3409. Thanks!

@P4Cu
Copy link
Author

P4Cu commented Apr 5, 2025

IMHO no reason.

@P4Cu
Copy link
Author

P4Cu commented Jun 28, 2025

@jamestrew Could you merge?

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
2 participants