aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Kuzminski <marcin@python-works.com>2013-01-10 17:38:34 +0100
committerMarcin Kuzminski <marcin@python-works.com>2013-01-10 17:38:34 +0100
commitecc9a0179ae83ee1097255a3cd795a2267bf78ba (patch)
treeb038abcd2419c1bb96b49d2839324848eafa65dc
parenta3f2a309ab49a741186ac450b349de62f75066aa (diff)
fixed fetch command for git repos, now it properly fetches from remotes
--HG-- branch : beta
-rw-r--r--rhodecode/lib/vcs/backends/git/repository.py11
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