Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use treeless instead of depth1 #5509

Merged
merged 1 commit into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion xmake/actions/update/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ function main()
http.download(url, installerfile)
end
else
git.clone(url, {depth = 1, recurse_submodules = not script_only, branch = version, outputdir = sourcedir})
git.clone(url, {treeless = true, recurse_submodules = not script_only, branch = version, outputdir = sourcedir})
end
return true
end,
Expand Down
8 changes: 7 additions & 1 deletion xmake/modules/devel/git/clone.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ end
-- import("devel.git")
--
-- git.clone("[email protected]:xmake-io/xmake.git")
-- git.clone("[email protected]:xmake-io/xmake.git", {depth = 1, branch = "master", outputdir = "/tmp/xmake", longpaths = true})
-- git.clone("[email protected]:xmake-io/xmake.git", {depth = 1, treeless = true, branch = "master", outputdir = "/tmp/xmake", longpaths = true})
--
-- @endcode
--
Expand All @@ -87,6 +87,12 @@ function main(url, opt)
table.insert(argv, type(opt.depth) == "number" and tostring(opt.depth) or opt.depth)
end

-- treeless?
-- @see https://github.com/xmake-io/xmake/issues/5507
if opt.treeless then
table.insert(argv, "--filter=tree:0")
end

-- recursive?
if opt.recursive then
table.insert(argv, "--recursive")
Expand Down
2 changes: 1 addition & 1 deletion xmake/modules/package/manager/conan/v1/install_package.lua
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function _conan_install_xmake_generator(conan)
-- clone xmake generator repository
local ok = false
for _, url in ipairs(mainurls) do
ok = try { function () git.clone(url, {depth = 1, branch = "0.1.0/testing", outputdir = xmake_generator_localdir}); return true end }
ok = try { function () git.clone(url, {treeless = true, branch = "0.1.0/testing", outputdir = xmake_generator_localdir}); return true end }
if ok then
break
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function _checkout(package, url, sourcedir, opt)
end

-- only shallow clone this branch
git.clone(url, {depth = 1, recursive = true, shallow_submodules = true, longpaths = longpaths, branch = branch, outputdir = packagedir})
git.clone(url, {treeless = true, recursive = true, shallow_submodules = true, longpaths = longpaths, branch = branch, outputdir = packagedir})

-- download package from revision or tag?
else
Expand All @@ -117,7 +117,7 @@ function _checkout(package, url, sourcedir, opt)
-- only shallow clone this tag
-- @see https://github.com/xmake-io/xmake/issues/4151
if tag and git.clone.can_clone_tag() then
git.clone(url, {depth = 1, recursive = true, shallow_submodules = true, longpaths = longpaths, branch = tag, outputdir = packagedir})
git.clone(url, {treeless = true, recursive = true, shallow_submodules = true, longpaths = longpaths, branch = tag, outputdir = packagedir})
else

-- clone whole history and tags
Expand Down
2 changes: 1 addition & 1 deletion xmake/modules/private/utils/statistics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function main()
{
function ()
import("devel.git.clone")
clone("https://github.com/xmake-io/xmake-stats.git", {depth = 1, branch = "master", outputdir = outputdir})
clone("https://github.com/xmake-io/xmake-stats.git", {treeless = true, branch = "master", outputdir = outputdir})
print("post to traffic ok!")
end
}
Expand Down
Loading