Skip to content

Commit a504b49

Browse files
authored
Merge pull request #52 from nickautomatic/avoid-duplication
Don't append co-authors to commit message more than once
2 parents d8c01f7 + cd3f20d commit a504b49

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

hook-examples/prepare-commit-msg-nodejs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ if(/COMMIT_EDITMSG/g.test(commitMessage)){
1515
// opens .git/COMMIT_EDITMSG
1616
contents = fs.readFileSync(commitMessage);
1717

18+
if(contents.indexOf(stdout.trim()) !== -1) {
19+
process.exit(0);
20+
}
21+
1822
const commentPos = contents.indexOf('# ');
1923
const gitMessage = contents.slice(0, commentPos);
2024
const gitComments = contents.slice(commentPos)

0 commit comments

Comments
 (0)