gitui
gitui copied to clipboard
Crash when stashing current directory
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:
- In a repository, create a new directory (e.g.
mkdir test/) and add new files (e.g.touch test/file.txt) - Go into the new directory (
cd test) and startgitui - Go to the stashing tab and put the new file (
test/file.txt) to the stash - 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)