changeset 3157:a73aca2075b8 beta

fixed fetch command for git repos, now it properly fetches from remotes
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 10 Jan 2013 17:38:34 +0100
parents 1ab01549f1f8
children 55ff0b9ef89e
files rhodecode/lib/vcs/backends/git/repository.py
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/lib/vcs/backends/git/repository.py	Thu Jan 10 02:50:39 2013 +0100
+++ b/rhodecode/lib/vcs/backends/git/repository.py	Thu Jan 10 17:38:34 2013 +0100
@@ -606,10 +606,13 @@
         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