From 7e975343c7f00e98962d2edd07ac87630c4936c4 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Thu, 23 Oct 2014 17:41:23 +0100 Subject: Remove unused code from morphlib.git There is still code here that duplicates stuff the GitDirectory class should be doing, I think. --- morphlib/git.py | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/morphlib/git.py b/morphlib/git.py index 944ddc30..456aa4c0 100644 --- a/morphlib/git.py +++ b/morphlib/git.py @@ -14,7 +14,6 @@ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -import binascii import cliapp import ConfigParser import logging @@ -23,10 +22,6 @@ import re import string import StringIO import sys -import time - - -import cliapp import morphlib @@ -226,11 +221,6 @@ def check_config_set(runcmd, keys, cwd='.'): return found -def set_remote(runcmd, gitdir, name, url): - '''Set remote with name 'name' use a given url at gitdir''' - return gitcmd(runcmd, 'remote', 'set-url', name, url, cwd=gitdir) - - def copy_repository(runcmd, repo, destdir, is_mirror=True): '''Copies a cached repository into a directory using cp. @@ -275,16 +265,6 @@ def copy_repository(runcmd, repo, destdir, is_mirror=True): gitcmd(runcmd, 'remote', 'update', 'origin', '--prune', cwd=destdir) -def index_has_changes(runcmd, gitdir): - '''Returns True if there are no staged changes to commit''' - try: - gitcmd(runcmd, 'diff-index', '--cached', '--quiet', - '--ignore-submodules', 'HEAD', cwd=gitdir) - except cliapp.AppException: - return True - return False - - def reset_workdir(runcmd, gitdir): '''Removes any differences between the current commit ''' '''and the status of the working directory''' @@ -312,10 +292,6 @@ def is_valid_sha1(ref): return len(ref) == 40 and all(x in string.hexdigits for x in ref) -def rev_parse(runcmd, gitdir, ref): - '''Find the sha1 for the given ref''' - return gitcmd(runcmd, 'rev-parse', '--verify', ref, cwd=gitdir)[0:40] - def gitcmd(runcmd, *args, **kwargs): '''Run git commands safely''' -- cgit v1.2.1