Skip to content

Commit 5aeee42

Browse files
committed
disable treeless for git #5507
1 parent e24fa86 commit 5aeee42

File tree

6 files changed

+6
-10
lines changed

6 files changed

+6
-10
lines changed

CHANGELOG.md

-4
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
### Changes
1212

13-
* [#5507](https://github.com/xmake-io/xmake/issues/5507): Use treeless to improve git.clone
14-
1513
### Bugs fixed
1614

1715
* [#4750](https://github.com/xmake-io/xmake/issues/4750): Fix compile_commands generator for `xmake tests`
@@ -1877,8 +1875,6 @@
18771875

18781876
### 改进
18791877

1880-
* [#5507](https://github.com/xmake-io/xmake/issues/5507): 改进 git clone 下载速度
1881-
18821878
### Bugs 修复
18831879

18841880
* [#4750](https://github.com/xmake-io/xmake/issues/4750): 修复 compile_commands 生成器,支持 `xmake tests`

scripts/get.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ else
208208
git checkout -qf "$2"
209209
cd - || raise 'chdir failed!'
210210
else
211-
git clone --filter=tree:0 -b "$branch" "$gitrepo" --recurse-submodules $projectdir || raise "clone failed, check your network or branch name"
211+
git clone --depth=1 -b "$branch" "$gitrepo" --recurse-submodules $projectdir || raise "clone failed, check your network or branch name"
212212
fi
213213
fi
214214

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, {treeless = true, recurse_submodules = not script_only, branch = version, outputdir = sourcedir})
487+
git.clone(url, {depth = 1, recurse_submodules = not script_only, branch = version, outputdir = sourcedir})
488488
end
489489
return true
490490
end,

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, {treeless = true, branch = "0.1.0/testing", outputdir = xmake_generator_localdir}); return true end }
112+
ok = try { function () git.clone(url, {depth = 1, 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, {treeless = true, recursive = true, shallow_submodules = true, longpaths = longpaths, branch = branch, outputdir = packagedir})
99+
git.clone(url, {depth = 1, 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, {treeless = true, recursive = true, shallow_submodules = true, longpaths = longpaths, branch = tag, outputdir = packagedir})
120+
git.clone(url, {depth = 1, 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", {treeless = true, branch = "master", outputdir = outputdir})
124+
clone("https://github.com/xmake-io/xmake-stats.git", {depth = 1, branch = "master", outputdir = outputdir})
125125
print("post to traffic ok!")
126126
end
127127
}

0 commit comments

Comments
 (0)