summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alvarez <pedro.alvarez@codethink.co.uk>2016-08-05 12:50:18 +0000
committerPedro Alvarez <pedro.alvarez@codethink.co.uk>2016-08-05 12:50:18 +0000
commitb090c8ce1c7d09a757157c51ba2214f26c3c2a1f (patch)
tree56869c7e215042af2e0e9ff9db67ca88875c792c
parent708920c8344084475be2c4e9937acfbeb53061f7 (diff)
downloadmorph-b090c8ce1c7d09a757157c51ba2214f26c3c2a1f.tar.gz
Make morphcacheserver use rev-list -1 too
Change-Id: I0e42ee2fa7545aadd8483ffd9f23ebeaf1d8f2c9
-rw-r--r--morphcacheserver/repocache.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/morphcacheserver/repocache.py b/morphcacheserver/repocache.py
index d45cf86a..3a2d3489 100644
--- a/morphcacheserver/repocache.py
+++ b/morphcacheserver/repocache.py
@@ -65,7 +65,7 @@ class RepoCache(object):
if (not self.direct_mode and
not ref.startswith('refs/origin/')):
ref = 'refs/origin/' + ref
- sha1 = self._rev_parse(repo_dir, ref)
+ sha1 = self._rev_list_1(repo_dir, ref)
return sha1, self._tree_from_commit(repo_dir, sha1)
except cliapp.AppException:
@@ -89,7 +89,7 @@ class RepoCache(object):
if not os.path.exists(repo_dir):
raise RepositoryNotFoundError(repo_url)
try:
- sha1 = self._rev_parse(repo_dir, ref)
+ sha1 = self._rev_list_1(repo_dir, ref)
except BaseException:
raise InvalidReferenceError(repo_url, ref)
@@ -108,7 +108,7 @@ class RepoCache(object):
raise RepositoryNotFoundError(repo_url)
try:
- sha1 = self._rev_parse(repo_dir, ref)
+ sha1 = self._rev_list_1(repo_dir, ref)
except BaseException:
raise InvalidReferenceError(repo_url, ref)
@@ -140,8 +140,8 @@ class RepoCache(object):
transl = lambda x: x if x in valid_chars else '_'
return ''.join([transl(x) for x in url])
- def _rev_parse(self, repo_dir, ref):
- return self.app.runcmd(['git', 'rev-parse', '--verify', ref],
+ def _rev_list_1(self, repo_dir, ref):
+ return self.app.runcmd(['git', 'rev-list', '-1', ref],
cwd=repo_dir)[0:40]
def _cat_file(self, repo_dir, sha1, filename):