diff options
author | Leandro Lucarella <leandro.lucarella@sociomantic.com> | 2014-11-14 18:33:52 +0100 |
---|---|---|
committer | Mihails Strasuns <mihails.strasuns@sociomantic.com> | 2014-11-24 17:11:37 +0100 |
commit | 3f139db14daae15e567a5d7f80e32f413b23cb28 (patch) | |
tree | aa6a922c131e11c779054e85a900618990ccaeb5 | |
parent | 4226335ddf8498607accd46843ade892cb94443c (diff) |
Check pull request status before merging
Fixes #88.
-rwxr-xr-x | git-hub | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -1622,6 +1622,23 @@ class RebaseCmd (PullUtil): "in a mergeable state") elif answer == 'no': sys.exit(0) + # Check status + status = req.get('/repos/%s/commits/%s/status' % + (config.upstream, pull['head']['sha'])) + state = status['state'] + statuses = status['statuses'] + if len(statuses) > 0 and state != 'success': + url = statuses[0]['target_url'] + answer = ask("The current pull request status is '%s' " + "(take a look at %s for more information), " + "do you want to continue anyway?" % + (state, url), default="no") + if answer is None: + die("Can't continue, the pull request status " + "is '{}' (take a look at {} for more " + "information)", state, url) + elif answer == 'no': + sys.exit(0) return pull # Returns the name of the temporary branch to work on while doing the |