comparison rhodecode/lib/vcs/backends/git/repository.py @ 2183:9d27481228a1 beta

Extend GIT command wrapper with GIT_CONFIG_NOGLOBAL=1 to bypass gitconfig global
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 11 Apr 2012 23:10:46 +0200
parents 092080cd96ba
children 9784a54a0f5b
comparison
equal deleted inserted replaced
2182:f635e8bdfb60 2183:9d27481228a1
76 at Dulwich (see https://bugs.launchpad.net/bugs/645142). Parsing 76 at Dulwich (see https://bugs.launchpad.net/bugs/645142). Parsing
77 os command's output is road to hell... 77 os command's output is road to hell...
78 78
79 :param cmd: git command to be executed 79 :param cmd: git command to be executed
80 """ 80 """
81
81 #cmd = '(cd %s && git %s)' % (self.path, cmd) 82 #cmd = '(cd %s && git %s)' % (self.path, cmd)
82 if isinstance(cmd, basestring): 83 if isinstance(cmd, basestring):
83 cmd = 'git %s' % cmd 84 cmd = 'GIT_CONFIG_NOGLOBAL=1 git %s' % cmd
84 else: 85 else:
85 cmd = ['git'] + cmd 86 cmd = ['GIT_CONFIG_NOGLOBAL=1', 'git'] + cmd
86 try: 87 try:
87 opts = dict( 88 opts = dict(
88 shell=isinstance(cmd, basestring), 89 shell=isinstance(cmd, basestring),
89 stdout=PIPE, 90 stdout=PIPE,
90 stderr=PIPE) 91 stderr=PIPE)