From a33a6cc23e91f665d9859e407d320563c233758d Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Wed, 18 Nov 2009 21:03:06 -0800 Subject: [PATCH] gitcmds: Use current_branch() instead of depending on the model Signed-off-by: David Aguilar --- cola/gitcmds.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cola/gitcmds.py b/cola/gitcmds.py index bcbc5817..ddcf6615 100644 --- a/cola/gitcmds.py +++ b/cola/gitcmds.py @@ -8,25 +8,26 @@ from cola import utils def default_remote(): """Return the remote tracked by the current branch.""" - model = cola.model() - branch = model.currentbranch + branch = current_branch() branchconfig = 'branch.%s.remote' % branch + model = cola.model() return model.local_config(branchconfig, 'origin') def corresponding_remote_ref(): """Return the remote branch tracked by the current branch.""" - model = cola.model() remote = default_remote() - branch = model.currentbranch + branch = current_branch() best_match = '%s/%s' % (remote, branch) - remote_branches = model.remote_branches + remote_branches = branch_list(remote=True) if not remote_branches: return remote for rb in remote_branches: if rb == best_match: return rb - return remote_branches[0] + if remote_branches: + return remote_branches[0] + return remote def diff_filenames(arg): -- 2.11.4.GIT