1 Star 1 Fork 0

wl4g-collect/git-2.27.0

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
version.c 718 Bytes
一键复制 编辑 原始数据 按行查看 历史
wanglsir 提交于 2021-05-24 11:40 . Init Commit
#include "git-compat-util.h"
#include "version.h"
#include "strbuf.h"
const char git_version_string[] = GIT_VERSION;
const char git_built_from_commit_string[] = GIT_BUILT_FROM_COMMIT;
const char *git_user_agent(void)
{
static const char *agent = NULL;
if (!agent) {
agent = getenv("GIT_USER_AGENT");
if (!agent)
agent = GIT_USER_AGENT;
}
return agent;
}
const char *git_user_agent_sanitized(void)
{
static const char *agent = NULL;
if (!agent) {
struct strbuf buf = STRBUF_INIT;
int i;
strbuf_addstr(&buf, git_user_agent());
strbuf_trim(&buf);
for (i = 0; i < buf.len; i++) {
if (buf.buf[i] <= 32 || buf.buf[i] >= 127)
buf.buf[i] = '.';
}
agent = buf.buf;
}
return agent;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/wl4g-collect/git-2.27.0.git
git@gitee.com:wl4g-collect/git-2.27.0.git
wl4g-collect
git-2.27.0
git-2.27.0
master

搜索帮助