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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user