MCPcopy Create free account
hub / github.com/git/git / os_info

Function os_info

version.c:46–60  ·  view source on GitHub ↗

Retrieve, sanitize and cache operating system info for subsequent calls. Return a pointer to the sanitized operating system info string. */

Source from the content-addressed store, hash-verified

44 string.
45*/
46static const char *os_info(void)
47{
48 static const char *os = NULL;
49
50 if (!os) {
51 struct strbuf buf = STRBUF_INIT;
52
53 get_uname_info(&buf, 0);
54 /* Sanitize the os information immediately */
55 redact_non_printables(&buf);
56 os = strbuf_detach(&buf, NULL);
57 }
58
59 return os;
60}
61
62const char *git_user_agent_sanitized(void)
63{

Callers 1

git_user_agent_sanitizedFunction · 0.85

Calls 3

get_uname_infoFunction · 0.85
redact_non_printablesFunction · 0.85
strbuf_detachFunction · 0.85

Tested by

no test coverage detected