gitui-org / gitui-org/gitui

Crash when stashing current directory

Open
#2,651 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
22.5k
Forks
773
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
When you start gitui in a newly created directory, and then stash away all changes in that new directory, gitui crashes with this error:

```
Error: git error:failed to resolve path '.': No such file or directory; class=Os (2); code=NotFound (-3)

Caused by:
failed to resolve path '.': No such file or directory; class=Os (2); code=NotFound (-3)
```

**To Reproduce**
Steps to reproduce the behavior:
1. In a repository, create a new directory (e.g. `mkdir test/`) and add new files (e.g. `touch test/file.txt`)
2. Go into the new directory (`cd test`) and start `gitui`
3. Go to the stashing tab and put the new file (`test/file.txt`) to the stash
4. See error

**Expected behavior**
The program doesn't crash, or if it does, it shows a nice(r) error message. There are many reasonable behavior possible, such as not relying on the current working directory existing, or falling back to the git root as the current working directory, or refusing to stash away the current working directory. I think anything would be better than the current error message.

**Context:**
- OS/Distro + Version: Fedora Linux 42
- GitUI Version gitui 0.26.3 2025-04-22 ()
- Rust version: cargo 1.86.0 (adf9b6ad1 2025-02-28)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.