| 60 | } |
| 61 | |
| 62 | const char *git_user_agent_sanitized(void) |
| 63 | { |
| 64 | static const char *agent = NULL; |
| 65 | |
| 66 | if (!agent) { |
| 67 | struct strbuf buf = STRBUF_INIT; |
| 68 | |
| 69 | strbuf_addstr(&buf, git_user_agent()); |
| 70 | |
| 71 | if (!getenv("GIT_USER_AGENT")) { |
| 72 | strbuf_addch(&buf, '-'); |
| 73 | strbuf_addstr(&buf, os_info()); |
| 74 | } |
| 75 | redact_non_printables(&buf); |
| 76 | agent = strbuf_detach(&buf, NULL); |
| 77 | } |
| 78 | |
| 79 | return agent; |
| 80 | } |
| 81 | |
| 82 | int get_uname_info(struct strbuf *buf, unsigned int full) |
| 83 | { |
no test coverage detected