-- SPDX-FileCopyrightText: Amolith <amolith@secluded.site>
--
-- SPDX-License-Identifier: GPL-3.0-or-later

local M = {}

--- Execute a git command with config to suppress noise while preserving errors
---@param cmd string git subcommand and arguments (without "git" prefix)
---@return boolean success
function M.git(cmd)
	local prefix = "git -c init.defaultBranch=main -c user.email=test@test.com "
		.. "-c user.name=Test -c advice.detachedHead=false "
	return os.execute(prefix .. cmd)
end

return M
