|
@@ -134,6 +134,7 @@ class UserAgent(object):
|
|
|
|
|
|
|
|
_os = None
|
|
_os = None
|
|
|
_repo_ua = None
|
|
_repo_ua = None
|
|
|
|
|
+ _git_ua = None
|
|
|
|
|
|
|
|
@property
|
|
@property
|
|
|
def os(self):
|
|
def os(self):
|
|
@@ -165,6 +166,17 @@ class UserAgent(object):
|
|
|
|
|
|
|
|
return self._repo_ua
|
|
return self._repo_ua
|
|
|
|
|
|
|
|
|
|
+ @property
|
|
|
|
|
+ def git(self):
|
|
|
|
|
+ """The UA when running git."""
|
|
|
|
|
+ if self._git_ua is None:
|
|
|
|
|
+ self._git_ua = 'git/%s (%s) git-repo/%s' % (
|
|
|
|
|
+ git.version_tuple().full,
|
|
|
|
|
+ self.os,
|
|
|
|
|
+ RepoSourceVersion())
|
|
|
|
|
+
|
|
|
|
|
+ return self._git_ua
|
|
|
|
|
+
|
|
|
user_agent = UserAgent()
|
|
user_agent = UserAgent()
|
|
|
|
|
|
|
|
def git_require(min_version, fail=False, msg=''):
|
|
def git_require(min_version, fail=False, msg=''):
|
|
@@ -214,6 +226,7 @@ class GitCommand(object):
|
|
|
if 'GIT_ALLOW_PROTOCOL' not in env:
|
|
if 'GIT_ALLOW_PROTOCOL' not in env:
|
|
|
_setenv(env, 'GIT_ALLOW_PROTOCOL',
|
|
_setenv(env, 'GIT_ALLOW_PROTOCOL',
|
|
|
'file:git:http:https:ssh:persistent-http:persistent-https:sso:rpc')
|
|
'file:git:http:https:ssh:persistent-http:persistent-https:sso:rpc')
|
|
|
|
|
+ _setenv(env, 'GIT_HTTP_USER_AGENT', user_agent.git)
|
|
|
|
|
|
|
|
if project:
|
|
if project:
|
|
|
if not cwd:
|
|
if not cwd:
|