Skip to content

Commit 559827c

Browse files
authored
Merge pull request #5509 from xmake-io/treeless
use treeless instead of depth1
2 parents c80898e + 818b23b commit 559827c

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

xmake/actions/update/main.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ function main()
484484
http.download(url, installerfile)
485485
end
486486
else
487-
git.clone(url, {depth = 1, recurse_submodules = not script_only, branch = version, outputdir = sourcedir})
487+
git.clone(url, {treeless = true, recurse_submodules = not script_only, branch = version, outputdir = sourcedir})
488488
end
489489
return true
490490
end,

xmake/modules/devel/git/clone.lua

+7-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ end
6262
-- import("devel.git")
6363
--
6464
-- git.clone("[email protected]:xmake-io/xmake.git")
65-
-- git.clone("[email protected]:xmake-io/xmake.git", {depth = 1, branch = "master", outputdir = "/tmp/xmake", longpaths = true})
65+
-- git.clone("[email protected]:xmake-io/xmake.git", {depth = 1, treeless = true, branch = "master", outputdir = "/tmp/xmake", longpaths = true})
6666
--
6767
-- @endcode
6868
--
@@ -87,6 +87,12 @@ function main(url, opt)
8787
table.insert(argv, type(opt.depth) == "number" and tostring(opt.depth) or opt.depth)
8888
end
8989

90+
-- treeless?
91+
-- @see https://github.com/xmake-io/xmake/issues/5507
92+
if opt.treeless then
93+
table.insert(argv, "--filter=tree:0")
94+
end
95+
9096
-- recursive?
9197
if opt.recursive then
9298
table.insert(argv, "--recursive")

xmake/modules/package/manager/conan/v1/install_package.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ function _conan_install_xmake_generator(conan)
109109
-- clone xmake generator repository
110110
local ok = false
111111
for _, url in ipairs(mainurls) do
112-
ok = try { function () git.clone(url, {depth = 1, branch = "0.1.0/testing", outputdir = xmake_generator_localdir}); return true end }
112+
ok = try { function () git.clone(url, {treeless = true, branch = "0.1.0/testing", outputdir = xmake_generator_localdir}); return true end }
113113
if ok then
114114
break
115115
end

xmake/modules/private/action/require/impl/actions/download.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ function _checkout(package, url, sourcedir, opt)
9696
end
9797

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

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

123123
-- clone whole history and tags

xmake/modules/private/utils/statistics.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ function main()
121121
{
122122
function ()
123123
import("devel.git.clone")
124-
clone("https://github.com/xmake-io/xmake-stats.git", {depth = 1, branch = "master", outputdir = outputdir})
124+
clone("https://github.com/xmake-io/xmake-stats.git", {treeless = true, branch = "master", outputdir = outputdir})
125125
print("post to traffic ok!")
126126
end
127127
}

0 commit comments

Comments
 (0)