Changeset - a73aca2075b8
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2013-01-10 17:38:34
marcin@python-works.com
fixed fetch command for git repos, now it properly fetches from remotes
1 file changed with 7 insertions and 4 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/vcs/backends/git/repository.py
Show inline comments
 
@@ -603,16 +603,19 @@ class GitRepository(BaseRepository):
 

	
 
    def fetch(self, url):
 
        """
 
        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
 
    def workdir(self):
 
        """
 
        Returns ``Workdir`` instance for this repository.
0 comments (0 inline, 0 general)