1 Star 0 Fork 0

SnowLeaf / git

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
version.c 651 Bytes
一键复制 编辑 原始数据 按行查看 历史
#include "git-compat-util.h"
#include "version.h"
#include "strbuf.h"
const char git_version_string[] = GIT_VERSION;
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;
}
1
https://gitee.com/snow.leaf/git.git
git@gitee.com:snow.leaf/git.git
snow.leaf
git
git
master

搜索帮助