summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2016-08-05 13:25:42 +0000
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2016-08-05 13:25:42 +0000
commit285ca925e5c705b76755568b2962028cc7a869d9 (patch)
tree60a0ac2701fbccfbfd4d6940ff0ef06a20a0a76e
parentb090c8ce1c7d09a757157c51ba2214f26c3c2a1f (diff)
downloadmorph-baserock/pedroalvarez/new-petrify.tar.gz
make morphcacheserver repocache resolve ref even if they look like a sha1baserock/pedroalvarez/new-petrify
Change-Id: I2d1da2c094a80b14d80e8b461072ec4097f946b9
-rw-r--r--morphcacheserver/repocache.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/morphcacheserver/repocache.py b/morphcacheserver/repocache.py
index 3a2d3489..1a023c5a 100644
--- a/morphcacheserver/repocache.py
+++ b/morphcacheserver/repocache.py
@@ -60,12 +60,12 @@ class RepoCache(object):
raise RepositoryNotFoundError(repo_url)
try:
if re.match('^[0-9a-fA-F]{40}$', ref):
- sha1 = ref
- else:
- if (not self.direct_mode and
- not ref.startswith('refs/origin/')):
- ref = 'refs/origin/' + ref
- sha1 = self._rev_list_1(repo_dir, ref)
+ pass
+ elif (not self.direct_mode and
+ not ref.startswith('refs/origin/') and
+ not re.match('^[0-9a-fA-F]{40}$', ref)):
+ ref = 'refs/origin/' + ref
+ sha1 = self._rev_list_1(repo_dir, ref)
return sha1, self._tree_from_commit(repo_dir, sha1)
except cliapp.AppException: