jesseduffield / lazygit

simple terminal UI for git commands
MIT License
50.47k stars 1.78k forks source link

Error when launching in a none repository folder #3849

Closed zoiman closed 6 days ago

zoiman commented 2 weeks ago

Describe the bug When I launch lazygit in a folder which is not a git repository I get the following error:

2024/08/23 17:59:42 An error occurred! Please create an issue at: https://github.com/jesseduffield/lazygit/issues

*errors.errorString 'git -C /Users/zoiman rev-parse --path-format=absolute --show-toplevel --absolute-git-dir --git-common-dir --is-bare-repository --show-superproject-working-tree' failed: Schwerwiegend: Kein Git-Repository (oder irgendeines der Elternverzeichnisse): .git

github.com/jesseduffield/lazygit/pkg/commands/git_commands/repo_paths.go:147 (0x10115eab8)
github.com/jesseduffield/lazygit/pkg/commands/git_commands/repo_paths.go:91 (0x10115e3c8)
github.com/jesseduffield/lazygit/pkg/commands/git_commands/repo_paths.go:83 (0x10115e2b4)
github.com/jesseduffield/lazygit/pkg/app/app.go:123 (0x101350248)
github.com/jesseduffield/lazygit/pkg/app/app.go:45 (0x10134fbf8)
github.com/jesseduffield/lazygit/pkg/app/entry_point.go:161 (0x101351840)
github.com/jesseduffield/lazygit/main.go:23 (0x1013533a8)
runtime/internal/atomic/types.go:194 (0x100c4ebbc)
runtime/asm_arm64.s:1222 (0x100c89004)

Version info: Run lazygit --version and paste the result here

commit=, build date=, build source=homebrew, version=0.43.1, os=darwin, arch=arm64, git version=2.46.0

Run git --version and paste the result here

git version 2.46.0

I reverted to the default config which result in the same issue.

stefanhaller commented 2 weeks ago

This is already fixed on master (see #3779). It's not released yet, so you could build from master or wait for the next release, which hopefully should happen in the not-too-distant future.

stefanhaller commented 6 days ago

Fixed in v0.44.