feat: test
This commit is contained in:
parent
1728ed955b
commit
1a71be38a3
|
@ -13,14 +13,17 @@ function getCurrentBranchName(p = process.cwd()) {
|
||||||
return headContent.trim().split('/')[2];
|
return headContent.trim().split('/')[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
const branchName = getCurrentBranchName();
|
const branchName = 'peterParkersl';
|
||||||
|
|
||||||
if (branchName) {
|
if (branchName) {
|
||||||
const msgPath = `.git/COMMIT_EDITMSG`;
|
const msgPath = `.git/COMMIT_EDITMSG`;
|
||||||
const msg = fs.readFileSync(msgPath, 'utf-8');
|
const msg = fs.readFileSync(msgPath, 'utf-8');
|
||||||
|
const reference = branchName.match(/^\d+/)[0];
|
||||||
|
|
||||||
const referenceTag = `refs #${branchName.match(/^\d+/)}`;
|
const referenceTag = `refs #${reference}`;
|
||||||
if (!msg.includes(referenceTag)) {
|
if (!msg.includes(referenceTag) && reference) {
|
||||||
|
console.log('reference: ', reference);
|
||||||
|
|
||||||
const splitedMsg = msg.split(':');
|
const splitedMsg = msg.split(':');
|
||||||
|
|
||||||
if (splitedMsg.length > 1) {
|
if (splitedMsg.length > 1) {
|
||||||
|
|
Loading…
Reference in New Issue