diff options
author | Michael Drake <michael.drake@codethink.co.uk> | 2015-04-13 14:17:29 +0000 |
---|---|---|
committer | Michael Drake <michael.drake@codethink.co.uk> | 2015-04-13 14:17:29 +0000 |
commit | c08f3b53e9813860085090b2c22ea3aecf525ae8 (patch) | |
tree | c2f8a6de38187afb44b0276fe9d8e256b2f4161b /morphlib/gitdir.py | |
parent | 1eb4aded65367880fe9b859d35b1a3c30ed846d6 (diff) | |
download | morph-c08f3b53e9813860085090b2c22ea3aecf525ae8.tar.gz |
Add version guessing funtion to gitdir and cached repo.
Change-Id: I1c79ce68a7a7534d36a9e83210e18a58e7b648e8
Diffstat (limited to 'morphlib/gitdir.py')
-rw-r--r-- | morphlib/gitdir.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/morphlib/gitdir.py b/morphlib/gitdir.py index 1c286720..9ec38865 100644 --- a/morphlib/gitdir.py +++ b/morphlib/gitdir.py @@ -707,6 +707,12 @@ class GitDirectory(object): args = ['branch', '--contains', ref] return self._gitcmd_output_list(*args) + def version_guess(self, ref): + self._check_ref_exists(ref) + + args = ['describe', '--tags', '--always', ref] + return morphlib.git.gitcmd(self._runcmd, *args).strip() + def _update_ref(self, ref_args, message): args = ['update-ref'] # No test coverage, since while this functionality is useful, |