fix: only use prepared commit message if run as hook #141
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem: The prepared commit message feature added in #122 sometimes sets a default from the
COMMIT_EDITMSG
file when I rungit cz
. As this message is from a previous commit it is annoying to see it there. It's not a huge problem in the subject as I will always overwrite a new subject, but in the body when I hit enter to leave the body empty it fills it with the default.Solution: Only set the default when cz-customizable has been run as a hook or in standalone mode
I couldn't think of a better way to detect whether to turn this feature on but I think this a safe solution and won't break it for anyone that is reliant on it