-
Notifications
You must be signed in to change notification settings - Fork 552
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
[Fix] Check for staged files prior to spawning the prompt #818
[Fix] Check for staged files prior to spawning the prompt #818
Conversation
Check for staged files before running the prompt. Running the `git-cz` command with no files staged reports "No files added to staging". Preserve the functionality of `git -a` (--all) flag - `git-cz -a` command with no files added to staging area, adds all files to staging and opens the prompt (no error thrown). "fix commitizen#785"
Extend upon the existing commit unit tests. Assert the error is thrown when running commitizen commit command with no files add to staging. "re commitizen#585"
Extend upon the existing staging unit tests. Assert that the files are added to staging area when running commitizen commit command with -a (--all) flag, prior to spawning the prompt. "re commitizen#785"
Love this, thank you for adding it! I run into this several times a day because I'm used to running
|
Any updates on the PR review? |
Yeah this would be awesome to get a review of this, thank you! |
Thanks! Sorry for the delay on this |
👏 yay! Thank you so much! Can't wait for this to be released, appreciate all the hard work @LinusU! |
🎉 This PR is included in version 4.2.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Fixes #785 and #585 (since the cause of these issues was related)
Changes
git-cz
,git-cz
command) throw "No files added to staging!" error ,git -a
flag (--all
) - runninggit-cz --all
should add all the changed files to the staging area prior to spawning the prompt (no error thrown),Checklist
After the changes I ensured that:
npm run test
,npm run build
,mkdir test && cd test && npm init -y && git init
),cz-cli
package by runningnpm run build
, from within cz-cli directory,node /path/to/cz-cli/project/bin/git-cz
(with and without—all
flag, in different case scenarios),Done