Created
July 10, 2015 18:11
-
-
Save dholdren/5714655686d5f962a488 to your computer and use it in GitHub Desktop.
prevent merge when there's multiple commits in a PR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var num_commits = parseInt($('#commits_tab_counter').text()); | |
var button = $("div.merge-message > button"); | |
if (num_commits > 1) { | |
console.log("disabling"); | |
button.attr('disabled','disabled'); | |
button.text("Squash those commits!"); | |
div = $("div.merge-message"); | |
div.append("<button class='btn btn-primary' id='enable_merge' style='float:right;' type='button'>Override</button>"); | |
enable_button = $('button#enable_merge'); | |
enable_button.on('click', function() { | |
console.log("re-enabling button"); | |
button.removeAttr('disabled'); | |
button.text("Merge without squash"); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment