Skip to content

Commit

Permalink
fix(git): better commit message robustness (renovatebot#12246)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhys Arkins authored Oct 21, 2021
1 parent 8112cf8 commit 5af1b77
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/workers/repository/model/commit-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ export class CommitMessage {
}

public setMessage(message: string): void {
this.message = message.trim();
this.message = (message || '').trim();
}

public setCustomPrefix(prefix = ''): void {
this.prefix = prefix.trim();
public setCustomPrefix(prefix?: string): void {
this.prefix = (prefix || '').trim();
}

public setSemanticPrefix(type = '', scope = ''): void {
this.prefix = type.trim();
public setSemanticPrefix(type?: string, scope?: string): void {
this.prefix = (type || '').trim();

if (scope.trim()) {
if (scope?.trim()) {
this.prefix += `(${scope.trim()})`;
}
}
Expand Down

0 comments on commit 5af1b77

Please sign in to comment.