bendera / vscode-commit-message-editor

Edit commit messages in a convenient way.
https://marketplace.visualstudio.com/items?itemName=adam-bender.commit-message-editor
MIT License
70 stars 13 forks source link

🐛 fix the bug that the extension does not work for the first commit #96

Closed shinyypig closed 1 year ago

shinyypig commented 1 year ago

When creating the webview, the code in https://github.com/bendera/vscode-commit-message-editor/blob/6c6e0f3ca218b0e7706f429a5052869388a3a20e/src/commands/EditorController.ts#L56 tries to get the history messages of commits. However, for the first commit, there is no history message, and the corresponding 'get message' function will throw an error. I have changed the code such that it simply returns an empty.

bendera commented 1 year ago

Nice catch! (No pun intended.)Thanks a lot!