diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2012-09-06 18:17:02 +0100 |
---|---|---|
committer | Jannis Pohlmann <jannis.pohlmann@codethink.co.uk> | 2012-09-10 12:56:51 +0000 |
commit | 941adb363e4e0d548c9507e6a48d98990c692260 (patch) | |
tree | 87e031a466277c0e35645e52b4a82087aed02afc | |
parent | 80fe58395087d15b2cee2584ea63f361dc12af10 (diff) | |
download | morph-941adb363e4e0d548c9507e6a48d98990c692260.tar.gz |
Git rid of morphlib.git methods that are not needed
-rw-r--r-- | morphlib/git.py | 8 | ||||
-rw-r--r-- | morphlib/plugins/branch_and_merge_plugin.py | 2 |
2 files changed, 1 insertions, 9 deletions
diff --git a/morphlib/git.py b/morphlib/git.py index f5722ebe..0a4b01f4 100644 --- a/morphlib/git.py +++ b/morphlib/git.py @@ -150,14 +150,6 @@ def checkout_ref(runcmd, gitdir, ref): '''Checks out a specific ref/SHA1 in a git working tree.''' runcmd(['git', 'checkout', ref], cwd=gitdir) -def ref_exists(runcmd, gitdir, ref): - '''Check if specific ref exists locally or in a remote.''' - try: - runcmd(['git', 'show-ref', '--quiet', ref], cwd=gitdir) - except cliapp.AppException: - return False - return True - def reset_workdir(runcmd, gitdir): '''Removes any differences between the current commit ''' '''and the status of the working directory''' diff --git a/morphlib/plugins/branch_and_merge_plugin.py b/morphlib/plugins/branch_and_merge_plugin.py index 06fc5a9d..a3681909 100644 --- a/morphlib/plugins/branch_and_merge_plugin.py +++ b/morphlib/plugins/branch_and_merge_plugin.py @@ -409,7 +409,7 @@ class BranchAndMergePlugin(cliapp.Plugin): self.clone_to_directory(repo_dir, repo, commit) # Check if branch already exists locally or in a remote - if morphlib.git.ref_exists(self.app.runcmd, repo_dir, new_branch): + if self.resolve_ref(repo_dir, new_branch) is not None: raise cliapp.AppException('branch %s already exists in ' 'repository %s' % (new_branch, repo)) |