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

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

Closed
dsolerh opened this issue May 16, 2024 · 4 comments
Closed

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

dsolerh opened this issue May 16, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@dsolerh
Copy link

dsolerh commented May 16, 2024

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 dsolerh added the bug Something isn't working label May 16, 2024
@dsolerh
Copy link
Author

dsolerh commented May 16, 2024

I also want to try and fix this

@stefanhaller
Copy link
Collaborator

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
Copy link
Author

dsolerh commented May 16, 2024

I added the PR, how can I link it to this issue?
here's the link: #3568

stefanhaller added a commit that referenced this issue May 18, 2024
- **PR Description**
Use git's `--staged` flag to stash staged changes if available (requires
git 2.35.0 or later), and fall back to our previous method if not. This
is a lot faster than our previous method, and it fixes two bugs, see
linked issues.

Fixes #3333 and #3563.

- **Please check if the PR fulfills these requirements**

* [x] Cheatsheets are up-to-date (run `go generate ./...`)
* [x] Code has been formatted (see
[here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#code-formatting))
* [x] Tests have been added/updated (see
[here](https://github.com/jesseduffield/lazygit/blob/master/pkg/integration/README.md)
for the integration test guide)
* [x] Text is internationalised (see
[here](https://github.com/jesseduffield/lazygit/blob/master/CONTRIBUTING.md#internationalisation))
* [x] Docs (specifically `docs/Config.md`) have been updated if
necessary
* [x] You've read through your own file changes for silly mistakes etc
@stefanhaller
Copy link
Collaborator

Fixed by #3569.

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

2 participants