diff options
Diffstat (limited to 'morphcacheserver/repocache.py')
-rw-r--r-- | morphcacheserver/repocache.py | 10 |
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): |