]>
git.ipfire.org Git - thirdparty/git.git/blob - version.c
1 #include "git-compat-util.h"
5 const char git_version_string
[] = GIT_VERSION
;
7 const char *git_user_agent(void)
9 static const char *agent
= NULL
;
12 agent
= getenv("GIT_USER_AGENT");
14 agent
= GIT_USER_AGENT
;
20 const char *git_user_agent_sanitized(void)
22 static const char *agent
= NULL
;
25 struct strbuf buf
= STRBUF_INIT
;
28 strbuf_addstr(&buf
, git_user_agent());
30 for (i
= 0; i
< buf
.len
; i
++) {
31 if (buf
.buf
[i
] <= 32 || buf
.buf
[i
] >= 127)