Skip to content

Not working with git worktrees #46

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

Closed
mhuggins7278 opened this issue Oct 29, 2021 · 3 comments
Closed

Not working with git worktrees #46

mhuggins7278 opened this issue Oct 29, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@mhuggins7278
Copy link

Description

I recently switched over to using git worktrees instead fo branches and lazygit from inside of nvim won't load.

clone a repo using the --bare option
cd into repo dir

git worktree add branchName 
cd branchNamed
nvim . 

open a file.
launch lazygit

2021/10/28 21:43:38 An error occurred! Please create an issue at: https://github.com/jesseduffield/lazygit/issues

*fs.PathError stat /Users/markhuggins/dev/work/mosaic5.git/tearsheets-canary/.git/: not a directory
/home/runner/work/lazygit/lazygit/pkg/utils/errors.go:13 (0x159bbcb)
/home/runner/work/lazygit/lazygit/pkg/commands/git.go:113 (0x159bb9a)
/home/runner/work/lazygit/lazygit/pkg/commands/git.go:57 (0x159b319)
/home/runner/work/lazygit/lazygit/pkg/app/app.go:125 (0x164a885)
/home/runner/work/lazygit/lazygit/main.go:124 (0x164cafd)
/opt/hostedtoolcache/go/1.16.7/x64/src/runtime/proc.go:225 (0x10383b6)
/opt/hostedtoolcache/go/1.16.7/x64/src/runtime/asm_amd64.s:1371 (0x106c161)

Expected behavior
lazygit loads correctly

Desktop (please complete the following information):

  • nvim --version:
    NVIM v0.5.0
    Build type: Release
@mhuggins7278 mhuggins7278 added the bug Something isn't working label Oct 29, 2021
@kdheepak
Copy link
Owner

Submodules and worktrees don't work correctly because I think I'm not passing the right directory to the invocation of lazygit. The detection of the "directory" to be passed as a command line argument to lazygit needs to be updated. I'll look into this when I get the chance, but I'm a little swamped with a few other things at the moment, so not when exactly when that is going to happen.

@mhuggins7278 mhuggins7278 changed the title Not with git worktrees Not working with git worktrees Nov 22, 2021
@kdheepak kdheepak closed this as completed Mar 6, 2022
@kdheepak
Copy link
Owner

kdheepak commented Mar 6, 2022

This should be resolved now thanks for @thefux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants