diff options
author | Marcin Kuzminski <marcin@python-works.com> | 2013-01-10 17:38:34 +0100 |
---|---|---|
committer | Marcin Kuzminski <marcin@python-works.com> | 2013-01-10 17:38:34 +0100 |
commit | ecc9a0179ae83ee1097255a3cd795a2267bf78ba (patch) | |
tree | b038abcd2419c1bb96b49d2839324848eafa65dc /rhodecode | |
parent | a3f2a309ab49a741186ac450b349de62f75066aa (diff) |
fixed fetch command for git repos, now it properly fetches from remotes
--HG--
branch : beta
Diffstat (limited to 'rhodecode')
-rw-r--r-- | rhodecode/lib/vcs/backends/git/repository.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/rhodecode/lib/vcs/backends/git/repository.py b/rhodecode/lib/vcs/backends/git/repository.py index 61d8f600..8487863c 100644 --- a/rhodecode/lib/vcs/backends/git/repository.py +++ b/rhodecode/lib/vcs/backends/git/repository.py @@ -606,10 +606,13 @@ class GitRepository(BaseRepository): Tries to pull changes from external location. """ url = self._get_url(url) - cmd = ['fetch'] - cmd.append(url) - cmd = ' '.join(cmd) - # If error occurs run_git_command raises RepositoryError already + so, se = self.run_git_command('ls-remote %s' % url) + refs = [] + for line in (x for x in so.splitlines()): + sha, ref = line.split('\t') + refs.append(ref) + refs = ' '.join(('+%s:%s' % (r, r) for r in refs)) + cmd = '''ls-remote -h %s %s''' % (url, refs) self.run_git_command(cmd) @LazyProperty |