# HG changeset patch # User Marcin Kuzminski # Date 2013-01-10 16:38:34 # Node ID a73aca2075b8a6f47a3d02ecc83229d7974072e7 # Parent 1ab01549f1f88e41a64a826ba077da26b64cd303 fixed fetch command for git repos, now it properly fetches from remotes diff --git a/rhodecode/lib/vcs/backends/git/repository.py b/rhodecode/lib/vcs/backends/git/repository.py --- 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