Skip to content

Commit 6b5ee78

Browse files
committed
Check un-squashed commits
1 parent c738bd3 commit 6b5ee78

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/scripts/contentscript.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@
2020
} else {
2121
var isWipTitle = /(\[wip\]|\[do\s*not\s*merge\])/i.test(issueTitle);
2222
var isWipTaksList = $container.find('.timeline-comment:first input[type="checkbox"]:not(:checked)').length > 0;
23-
disabled = (isWipTitle || isWipTaksList);
23+
var isSquashCommits = false;
24+
$container.find('#commits_bucket .commit .commit-title').each(function(i, elem){
25+
isSquashCommits = isSquashCommits || $(elem).text().match(/^\s*(squash|fixup)!\s/);
26+
});
27+
disabled = (isWipTitle || isWipTaksList || isSquashCommits);
2428
buttonHtml = '<span class="octicon octicon-git-merge"></span> ' + (disabled ? 'WIP! You can\'t merge!' : 'Merge pull request');
2529
}
2630

0 commit comments

Comments
 (0)