From b549c36dd6359aa22f8636bee7204c4df338b4f6 Mon Sep 17 00:00:00 2001 From: Tiago Gomes Date: Wed, 11 Nov 2015 09:19:18 +0000 Subject: Remove old cruft Static analysis showed this code is not being used, and we can always bring it back if necessary through git. Change-Id: Id8bf7d73436b5c3d0dfe050befaae034a05afc86 --- morphlib/gitdir.py | 36 ------------------------------------ 1 file changed, 36 deletions(-) (limited to 'morphlib/gitdir.py') diff --git a/morphlib/gitdir.py b/morphlib/gitdir.py index d1770275..59a4be51 100644 --- a/morphlib/gitdir.py +++ b/morphlib/gitdir.py @@ -498,19 +498,6 @@ class GitDirectory(object): argv.append(base_ref) morphlib.git.gitcmd(self._runcmd, *argv) - def is_currently_checked_out(self, ref): # pragma: no cover - '''Is ref currently checked out?''' - - # Try the ref name directly first. If that fails, prepend origin/ - # to it. (FIXME: That's a kludge, and should be fixed.) - try: - parsed_ref = morphlib.git.gitcmd(self._runcmd, 'rev-parse', ref) - except cliapp.AppException: - parsed_ref = morphlib.git.gitcmd(self._runcmd, 'rev-parse', - 'origin/%s' % ref) - parsed_head = morphlib.git.gitcmd(self._runcmd, 'rev-parse', 'HEAD') - return parsed_ref.strip() == parsed_head.strip() - def get_file_from_ref(self, ref, filename): # pragma: no cover '''Get file contents from git by ref and filename. @@ -602,19 +589,6 @@ class GitDirectory(object): except cliapp.AppException as e: raise InvalidRefError(self, ref) - def disambiguate_ref(self, ref): # pragma: no cover - try: - out = morphlib.git.gitcmd(self._runcmd, 'rev-parse', - '--symbolic-full-name', ref) - return out.strip() - except cliapp.AppException: # ref not found - if ref.startswith('refs/heads/'): - return ref - elif ref.startswith('heads/'): - return 'refs/' + ref - else: - return 'refs/heads/' + ref - def get_upstream_of_branch(self, branch): # pragma: no cover try: out = morphlib.git.gitcmd( @@ -721,16 +695,6 @@ class GitDirectory(object): ''' return self._store_object(contents=blob_contents, type='blob') - def store_commit(self, commit_contents): # pragma: no cover - '''Hash `commit_contents`, store it in git and return the sha1. - - `commit_contents` must either be a string or a value suitable to - pass to subprocess.Popen i.e. a file descriptor or file object - with fileno() method. - - ''' - return self._store_object(contents=commit_contents, type='commit') - def _store_object(self, contents, type): if isinstance(contents, basestring): kwargs = {'feed_stdin': contents} -- cgit v1.2.1