diff options
author | Mykyta Holubakha <hilobakho@gmail.com> | 2017-08-29 04:55:07 +0300 |
---|---|---|
committer | Mykyta Holubakha <hilobakho@gmail.com> | 2017-08-29 04:55:07 +0300 |
commit | 56f741b0e4f0a5dd8f255dea90d2d18f9537fd02 (patch) | |
tree | d5116cb09d8faeab922955396d34e997dd052d71 /pomu/repo/remote/git.py | |
parent | Added missing init files (diff) | |
download | pomu-56f741b0e4f0a5dd8f255dea90d2d18f9537fd02.tar.gz pomu-56f741b0e4f0a5dd8f255dea90d2d18f9537fd02.tar.bz2 pomu-56f741b0e4f0a5dd8f255dea90d2d18f9537fd02.zip |
Remote hotfixes
Diffstat (limited to 'pomu/repo/remote/git.py')
-rw-r--r-- | pomu/repo/remote/git.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/pomu/repo/remote/git.py b/pomu/repo/remote/git.py index 217a0c6..2cb00d2 100644 --- a/pomu/repo/remote/git.py +++ b/pomu/repo/remote/git.py @@ -1,17 +1,18 @@ """A class for remote git repos""" -from os import chdir, mkdtemp, path +from os import chdir, path from subprocess import call +from tempfile import mkdtemp from git import Repo -from pomu.repo.remote import RemoteRepo, normalize_key +from pomu.repo.remote.remote import RemoteRepo, normalize_key from pomu.util.git import parse_object from pomu.util.result import Result class RemoteGitRepo(RemoteRepo): """A class responsible for git remotes""" def __init__(self, url): - self.uri = uri + self.uri = url self.dir = mkdtemp() chdir(self.dir) if call('git', 'clone', '--depth=1', '--bare', url) > 0: # we've a problem @@ -27,11 +28,11 @@ class RemoteGitRepo(RemoteRepo): def get_object(self, oid): head, tail = oid[0:2], oid[2:] opath = path.join(self.dir, 'objects', head, tail) - return a.read() + return opath.read() def _fetch_tree(self, obj, tpath): res = [] - ents = parse_object(self.get_object(tid), tpath).unwrap() + ents = parse_object(self.get_object(obj), tpath).unwrap() for is_dir, sha, opath in ents: res.append((opath + '/' if is_dir else '', sha)) if is_dir: |