diff options
author | Tiago Gomes <tiago.gomes@codethink.co.uk> | 2015-11-11 09:19:18 +0000 |
---|---|---|
committer | Baserock Gerrit <gerrit@baserock.org> | 2015-11-20 16:44:33 +0000 |
commit | b549c36dd6359aa22f8636bee7204c4df338b4f6 (patch) | |
tree | 8b36eadbe404f4925637b1b0292c0523a1540a93 /morphlib/gitdir.py | |
parent | fad8048de66fe6aeaa0478864914bb773f51ed3e (diff) | |
download | morph-b549c36dd6359aa22f8636bee7204c4df338b4f6.tar.gz |
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
Diffstat (limited to 'morphlib/gitdir.py')
-rw-r--r-- | morphlib/gitdir.py | 36 |
1 files changed, 0 insertions, 36 deletions
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} |