Skip to content

Commit 7ef8cc2

Browse files
committed
update prepareCommitMsg.ts
1 parent a70e6bb commit 7ef8cc2

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

src/prepareCommitMsg.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,16 @@ export function _combineOldAndNew(
256256
*
257257
* High-level function to process file changes and an old message, to generate a
258258
* replacement commit message.
259+
*
260+
* @param lines An array of values describing file change from Git output.
261+
* e.g. ["A baz.txt"]
262+
* @param oldMsg The commit message that was in UI box before running the
263+
* extension's command.
259264
*/
260265
export function _generateMsgWithOld(lines: string[], oldMsg: string) {
261266
if (oldMsg === "") {
262267
throw new Error(
263-
"`oldMsg` must be non-empty - or use `generateNewMsg` instead."
268+
"`oldMsg` must be non-empty here, or use `generateNewMsg` instead."
264269
);
265270
}
266271
const { typePrefix, description } = _msgFromChanges(lines);
@@ -278,7 +283,10 @@ export function _generateMsgWithOld(lines: string[], oldMsg: string) {
278283
* might be a commit message template that VS Code has filled in), or a commit
279284
* message template read from a file in the case of a hook flow without VS Code.
280285
*
281-
* @param lines A list of text values describing how files changes.
286+
* @param lines An array of values describing file change from Git output.
287+
* e.g. ["A baz.txt"]
288+
* @param oldMsg The commit message that was in UI box before running the
289+
* extension's command.
282290
*/
283291
export function generateMsg(lines: string[], oldMsg?: string): string {
284292
if (!oldMsg) {

0 commit comments

Comments
 (0)