Skip to content

Fixes #2083, #2539: Fixes stashing staged changes#2540

Merged
d13 merged 1 commit intogitkraken:mainfrom
ShafinKhadem:stash-only-staged
Mar 9, 2023
Merged

Fixes #2083, #2539: Fixes stashing staged changes#2540
d13 merged 1 commit intogitkraken:mainfrom
ShafinKhadem:stash-only-staged

Conversation

@ShafinKhadem
Copy link
Contributor

@ShafinKhadem ShafinKhadem commented Mar 4, 2023

Description

Fixes #2083, #2539: Fixes stashing staged changes

When stashing staged changes, filtering by pathspec doesn't work because a file can be partially staged. However with --staged flag, only the staged changes of a file can be stashed. This PR checks if the scm-group sent to the StashSaveCommand is 'index' and uses --staged flag instead of pathspec in that case.

Checklist

  • I have followed the guidelines in the Contributing document
  • My changes follow the coding style of this project
  • My changes build without any errors or warnings
  • My changes have been formatted and linted
  • My changes include any required corresponding changes to the documentation (including CHANGELOG.md and README.md)
  • My changes have been rebased and squashed to the minimal number (typically 1) of relevant commits
  • My changes have a descriptive commit message with a short title, including a Fixes $XXX - or Closes #XXX - prefix to auto-close the issue that your PR addresses

@d13 d13 self-requested a review March 8, 2023 15:42
@d13 d13 self-assigned this Mar 8, 2023
@d13 d13 force-pushed the stash-only-staged branch from 577c3d2 to 6ddde85 Compare March 9, 2023 20:44
Copy link
Member

@d13 d13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great @ShafinKhadem! Thanks for contributing!! 🎆

@d13 d13 merged commit dc02b23 into gitkraken:main Mar 9, 2023
@ShafinKhadem ShafinKhadem deleted the stash-only-staged branch March 20, 2023 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stashing deleted files reports error

2 participants