summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeandro Lucarella <leandro.lucarella@sociomantic.com>2014-11-14 18:33:32 +0100
committerMihails Strasuns <mihails.strasuns@sociomantic.com>2014-11-24 17:11:37 +0100
commit4226335ddf8498607accd46843ade892cb94443c (patch)
tree51778c374bd3f4149c8e78144a78cebbef523ebf
parentfd68c29224c057701abad104998331681045f0dd (diff)
Make code simpler by doing a check once
-rwxr-xr-xgit-hub6
1 files changed, 4 insertions, 2 deletions
diff --git a/git-hub b/git-hub
index bb00969..4282c49 100755
--- a/git-hub
+++ b/git-hub
@@ -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?",