Skip to content
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

adding unstaged changes when not in "work tree" yields only ambiguous error #2208

Open
zenodotus280 opened this issue Apr 28, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@zenodotus280
Copy link

zenodotus280 commented Apr 28, 2024

Describe the bug
When staging changes:

staging all error:
git error:invalid path: 'my-path-here'; class=Index (10)

A git repository is created using the --git-dir=/path/to/$FOLDER which will create the standard .git contents separate from the working files. If inside this folder gitui will not complain and will incorrectly show unstaged changes and not give suitable errors.

To Reproduce

mkdir -p ~/working_tree ~/git_folder && cd ~/working_tree
git init --git-dir ~/git_folder
touch readme.txt && git commit -a -c "init"
cd ~/.git_folder
git status
    # fatal: this operation must be run in a work tree
# gitui > "a" to add all files > error as specified at the top

Expected behavior
A clear and concise error similar to regular git commands.

Context (please complete the following information):

  • OS/Distro + Version: Arch / EndeavourOS
  • GitUI Version: nightly 2024-04-15
  • Rust version: 1.27.0

Additional context
I expect many more commands to fail for similar reasons. No others tested. The porcelain git commands give a more operable error.

@zenodotus280 zenodotus280 added the bug Something isn't working label Apr 28, 2024
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

1 participant