MCPcopy Index your code
hub / github.com/Tencent/CodeAnalysis / set_default_config

Method set_default_config

client/util/gitconfig.py:25–40  ·  view source on GitHub ↗

设置git默认配置 :return:

()

Source from the content-addressed store, hash-verified

23 """工具拉取管理类"""
24 @staticmethod
25 def set_default_config():
26 """
27 设置git默认配置
28 :return:
29 """
30 try:
31 # 设置git config --global core.longpaths true
32 # 防止在Windows下出现由于绝对路径过长(超出260字符)导致拉取失败的情况
33 # logger.info("设置git config --global core.longpaths true,预防git拉代码文件全路径过长错误。")
34 subprocess.check_call(["git", "config", "--global", "core.longpaths", "true"])
35
36 # 解决git命令行操作时中文文件名乱码
37 # logger.info("设置git config --global core.quotepath off,解决git命令行操作时中文文件名乱码。")
38 subprocess.check_call(["git", "config", "--global", "core.quotepath", "off"])
39 except Exception as err:
40 logger.warning(f"set git config encounter error: {str(err)}")
41
42 @staticmethod
43 def set_blame_ignore():

Callers 2

__init__Method · 0.80
runMethod · 0.80

Calls 1

warningMethod · 0.80

Tested by

no test coverage detected