Skip to content

Commit bfbce27

Browse files
authored
prr#44 prr crashes if only one line in the commit message (#45)
Reviewed by: Dan McDonald <danmcd@kebe.com>
1 parent 9530903 commit bfbce27

File tree

5 files changed

+712
-162
lines changed

5 files changed

+712
-162
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "deps/eng"]
22
path = deps/eng
3-
url = https://github.com/joyent/eng
3+
url = https://github.com/TritonDataCenter/eng

lib/prr.js

100644100755
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
/*
99
* Copyright 2020 Joyent, Inc.
10+
* Copyright 2022 MNX Cloud, Inc.
1011
*/
1112

1213
/*
@@ -530,8 +531,10 @@ function writeCommitMessage(args, cb) {
530531
remaining_messages = remaining_messages.slice(1);
531532
}
532533

533-
while (remaining_messages[0].trim() === '') {
534-
remaining_messages = remaining_messages.slice(1);
534+
if (remaining_messages.length > 0) {
535+
while (remaining_messages[0].trim() === '') {
536+
remaining_messages = remaining_messages.slice(1);
537+
}
535538
}
536539

537540
fs.writeSync(info.fd, format(

0 commit comments

Comments
 (0)