##// END OF EJS Templates
subrepo: support Git being named "git.cmd" on Windows (issue3173)...
Benjamin Pollack -
r17025:8ad08dca stable
parent child Browse files
Show More
@@ -850,6 +850,13 b' class gitsubrepo(abstractsubrepo):'
850 self._ensuregit()
850 self._ensuregit()
851
851
852 def _ensuregit(self):
852 def _ensuregit(self):
853 try:
854 self._gitexecutable = 'git'
855 out, err = self._gitnodir(['--version'])
856 except OSError, e:
857 if e.errno != 2 or os.name != 'nt':
858 raise
859 self._gitexecutable = 'git.cmd'
853 out, err = self._gitnodir(['--version'])
860 out, err = self._gitnodir(['--version'])
854 m = re.search(r'^git version (\d+)\.(\d+)\.(\d+)', out)
861 m = re.search(r'^git version (\d+)\.(\d+)\.(\d+)', out)
855 if not m:
862 if not m:
@@ -883,8 +890,8 b' class gitsubrepo(abstractsubrepo):'
883 errpipe = None
890 errpipe = None
884 if self._ui.quiet:
891 if self._ui.quiet:
885 errpipe = open(os.devnull, 'w')
892 errpipe = open(os.devnull, 'w')
886 p = subprocess.Popen(['git'] + commands, bufsize=-1, cwd=cwd, env=env,
893 p = subprocess.Popen([self._gitexecutable] + commands, bufsize=-1,
887 close_fds=util.closefds,
894 cwd=cwd, env=env, close_fds=util.closefds,
888 stdout=subprocess.PIPE, stderr=errpipe)
895 stdout=subprocess.PIPE, stderr=errpipe)
889 if stream:
896 if stream:
890 return p.stdout, None
897 return p.stdout, None
General Comments 0
You need to be logged in to leave comments. Login now