Skip to content

Conversation

@deepakmahakale
Copy link

@deepakmahakale deepakmahakale commented May 28, 2021

Fixes #751

Add staged_changes? check to avoid stashing files if no changes have been staged.

stashing the files with no staged changes ends up deleting all files

Add `staged_changes?` check to avoid stashing files if no changes have been staged.

stashing the files with no staged changes ends up deleting all files
@sds
Copy link
Owner

sds commented May 31, 2021

As you can see from the tests, this won't work.

In order to guarantee you are running checks against files that are staged or otherwise are the view that Git sees, we always need to stash any unstaged changes in tracked files.

The solution to this particular problem appears to be removing the --quiet flag from the call to git stash pop .... I'll do that in another PR.

@sds sds closed this May 31, 2021
@sds
Copy link
Owner

sds commented May 31, 2021

See 648383f.

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.

Deletes all files if we try to git commit without staging files

2 participants