jesseduffield / lazygit

simple terminal UI for git commands
MIT License
52.66k stars 1.84k forks source link

Error when stashing all (more than 1) your "staged" files #3563

Closed dsolerh closed 5 months ago

dsolerh commented 5 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Create changes on multiple files
  2. Press 'a' to stage them all
  3. Press 'S' to open the stash options menu
  4. Manually go to the option "Stash staged changes" and press Enter
  5. Leave the name for the stash blank just press enter

Expected behavior I expect not to be an error shown

Screenshots Steps 1 and 2

image

Step 3 and 4

image

Step 5

image

Result

image

Version info: commit=, build date=, build source=homebrew, version=0.41.0, os=darwin, arch=arm64, git version=2.44.0

Additional context Add any other context about the problem here.

Note: please try updating to the latest version or manually building the latest master to see if the issue still occurs.

dsolerh commented 5 months ago

I also want to try and fix this

stefanhaller commented 5 months ago

This one looks easy to fix. It seems that we only need to check if there are any unstaged changes, and if not, fall back to the normal, simple stash.

There's a different, but somewhat related problem that seems harder to fix: #3333. In case you feel like looking into that one, too.

dsolerh commented 5 months ago

I added the PR, how can I link it to this issue? here's the link: https://github.com/jesseduffield/lazygit/pull/3568

stefanhaller commented 5 months ago

Fixed by #3569.