diff options
author | Leandro Lucarella <leandro.lucarella@sociomantic.com> | 2014-11-14 18:33:32 +0100 |
---|---|---|
committer | Mihails Strasuns <mihails.strasuns@sociomantic.com> | 2014-11-24 17:11:37 +0100 |
commit | 4226335ddf8498607accd46843ade892cb94443c (patch) | |
tree | 51778c374bd3f4149c8e78144a78cebbef523ebf | |
parent | fd68c29224c057701abad104998331681045f0dd (diff) |
Make code simpler by doing a check once
-rwxr-xr-x | git-hub | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1603,14 +1603,16 @@ class RebaseCmd (PullUtil): infof("Nothing to do, already merged (--abort to get " "back to normal)") sys.exit(0) - if check_all and pull['state'] == 'closed': + if not check_all: + return pull + if pull['state'] == 'closed': answer = ask("The pull request is closed, are you sure " "you want to rebase it?", default="no") if answer is None: die("Can't rebase/merge, pull request is closed") elif answer == 'no': sys.exit(0) - if check_all and not pull['mergeable']: + if not pull['mergeable']: answer = ask("The pull request is not in a mergeable " "state (there are probably conflicts to " "resolve), do you want to continue anyway?", |