diff options
author | Michael Drake <michael.drake@codethink.co.uk> | 2015-04-13 14:17:29 +0000 |
---|---|---|
committer | Baserock Gerrit <gerrit@baserock.org> | 2015-04-28 15:53:08 +0000 |
commit | 87f8dbefda89bf6cb9e4b88f23a5317b054da0d4 (patch) | |
tree | 8c2028c45ae08fd5c7606d1ff2d093bd763c79f4 /morphlib/cachedrepo.py | |
parent | 2594f6d52878ef78d9809c52c7aebbe52434dba9 (diff) | |
download | morph-87f8dbefda89bf6cb9e4b88f23a5317b054da0d4.tar.gz |
Add version guessing function to gitdir and cached repo.
Change-Id: I1c79ce68a7a7534d36a9e83210e18a58e7b648e8
Diffstat (limited to 'morphlib/cachedrepo.py')
-rw-r--r-- | morphlib/cachedrepo.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/morphlib/cachedrepo.py b/morphlib/cachedrepo.py index 0c0f5cb7..a630cc29 100644 --- a/morphlib/cachedrepo.py +++ b/morphlib/cachedrepo.py @@ -143,6 +143,15 @@ class CachedRepo(object): ''' return self._gitdir.branches_containing_sha1(ref) + def version_guess(self, ref): # pragma: no cover + '''Guess version number using `git describe --tags` + + Raises a gitdir.InvalidRefError if the ref is not found in the + repository. + + ''' + return self._gitdir.version_guess(ref) + def list_files(self, ref, recurse=True): # pragma: no cover '''Return filenames found in the tree pointed to by the given ref. |