diff options
-rw-r--r-- | morphcacheserver/repocache.py | 12 |
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: |