NeogitOrg / neogit

An interactive and powerful Git interface for Neovim, inspired by Magit
MIT License
4.1k stars 241 forks source link

git_path is wrong when inside a git worktree #1474

Open entropitor opened 2 months ago

entropitor commented 2 months ago

Description

When you are developing code inside a git worktree, repo's git_path is wrong leading to not showing rebase in progress

https://github.com/NeogitOrg/neogit/blob/eb5b156a41fb7147eed9f971504dfa8753d8b006/lua/neogit/lib/git/repository.lua#L226 is just referencing .git/ while if .git is a file, it should read the gitDir from it and return that

Neovim version

NVIM v0.11.0-nightly+9570ad2 Build type: Release LuaJIT 2.1.1713773202 Run "nvim -V1 -v" for more info

Operating system and version

macOS

Steps to reproduce

Open Neogit in a git worktree while a rebase is in progress (rebase will not be shown)

Expected behavior

Rebase is shown in Neogit

Actual behavior

Rebase is not shown

Minimal config

Default config is fine