Skip to content

Minor bug when launching from a dir with deleted files #2180

@artfulrobot

Description

@artfulrobot

lazygit crashes like so:

% mkdir -p lgtest/aDir && cd lgtest 
% echo hi >aDir/file
% git init; git add .; git commit -m "initial"
  [main (root-commit) 848bf5c] initial
   1 file changed, 1 insertion(+)
   create mode 100644 aDir/file
% gs
  On branch main
  nothing to commit, working tree clean
% cd aDir 
% git rm file
  rm 'aDir/file'
% lg
2022/09/22 08:59:45 An error occurred! Please create an issue at: https://github.com/jesseduffield/lazygit/issues

*os.SyscallError getwd: no such file or directory
/home/runner/work/lazygit/lazygit/pkg/app/app.go:52 (0xa39416)
/home/runner/work/lazygit/lazygit/main.go:154 (0xa46e70)
/opt/hostedtoolcache/go/1.18.4/x64/src/runtime/proc.go:250 (0x4363d2)
/opt/hostedtoolcache/go/1.18.4/x64/src/runtime/asm_amd64.s:1571 (0x463bc1)

Version info:

commit=367b0d331836c90c015bf0c45f88612f3d94d08a, build date=2022-07-20T09:27:56Z, build source=binaryRelease, version=0.35, os=linux, arch=amd64

git version 2.30.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions