diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-02-20 11:13:24 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-02-20 13:48:43 +0000 |
commit | 1d7e39b955f4da58230f9c5a06ff1b05f8bc020b (patch) | |
tree | 0c2c0970bc0f49cce23ddf1ddabed88f70a0f663 /morphlib/localrepocache.py | |
parent | 9c53c8b12a2ff92e850daf3def87aa489dfafecf (diff) | |
download | morph-1d7e39b955f4da58230f9c5a06ff1b05f8bc020b.tar.gz |
sourceresolver: Factor out 'cache repo locally' code into a function
Also, move the repo.update() call into the 'fetch from tarball' code
path in the localrepocache module -- there's no need to update straight
after doing a `git clone`, but we do need to do one if we got the repo
from a `git archive` tarball that may be out of date.
Diffstat (limited to 'morphlib/localrepocache.py')
-rw-r--r-- | morphlib/localrepocache.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/morphlib/localrepocache.py b/morphlib/localrepocache.py index 9bccb20b..39fbd200 100644 --- a/morphlib/localrepocache.py +++ b/morphlib/localrepocache.py @@ -1,4 +1,4 @@ -# Copyright (C) 2012-2014 Codethink Limited +# Copyright (C) 2012-2015 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -204,7 +204,9 @@ class LocalRepoCache(object): if self._tarball_base_url: ok, error = self._clone_with_tarball(repourl, path) if ok: - return self.get_repo(reponame) + repo = self.get_repo(reponame) + repo.update() + return repo else: errors.append(error) self._app.status( |