fix(tests): specify initial branch when initializing git repository

Git may complain if init.defaultBranch is not set up on the system:

hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: 	git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint:
hint: 	git branch -m <name>
hint:
hint: Disable this message with "git config set advice.defaultBranchName false"

Use "git init -m main" to suppress this message.
This commit is contained in:
Dmitry Torokhov
2025-07-31 13:45:16 -07:00
committed by yetone
parent 61c1bf8bfe
commit 3b1f65e46d

View File

@@ -20,7 +20,7 @@ describe("llm_tools", function()
Config.setup()
-- 创建测试目录和文件
os.execute("mkdir -p " .. test_dir)
os.execute(string.format("cd %s; git init", test_dir))
os.execute(string.format("cd %s; git init -b main", test_dir))
local file = io.open(test_file, "w")
if not file then error("Failed to create test file") end
file:write("test content")