summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-08-27 00:29:23 +0800
committerruki <[email protected]>2024-08-27 00:29:23 +0800
commit5aeee42d72b7c2289a0179821db04c36751fc38e (patch)
tree7539dc14bf88551b7e1aad37022ab9768994112b
parente24fa86dbca00fdab06fd7c69ea201f280cfd4e9 (diff)
disable treeless for git #5507
-rw-r--r--CHANGELOG.md4
-rwxr-xr-xscripts/get.sh2
-rw-r--r--xmake/actions/update/main.lua2
-rw-r--r--xmake/modules/package/manager/conan/v1/install_package.lua2
-rw-r--r--xmake/modules/private/action/require/impl/actions/download.lua4
-rw-r--r--xmake/modules/private/utils/statistics.lua2
6 files changed, 6 insertions, 10 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a1a595a78..3a4c94ec4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,8 +10,6 @@
### Changes
-* [#5507](https://github.com/xmake-io/xmake/issues/5507): Use treeless to improve git.clone
-
### Bugs fixed
* [#4750](https://github.com/xmake-io/xmake/issues/4750): Fix compile_commands generator for `xmake tests`
@@ -1877,8 +1875,6 @@
### 改进
-* [#5507](https://github.com/xmake-io/xmake/issues/5507): 改进 git clone 下载速度
-
### Bugs 修复
* [#4750](https://github.com/xmake-io/xmake/issues/4750): 修复 compile_commands 生成器,支持 `xmake tests`
diff --git a/scripts/get.sh b/scripts/get.sh
index a2efbacf2..4b9c80156 100755
--- a/scripts/get.sh
+++ b/scripts/get.sh
@@ -208,7 +208,7 @@ else
git checkout -qf "$2"
cd - || raise 'chdir failed!'
else
- git clone --filter=tree:0 -b "$branch" "$gitrepo" --recurse-submodules $projectdir || raise "clone failed, check your network or branch name"
+ git clone --depth=1 -b "$branch" "$gitrepo" --recurse-submodules $projectdir || raise "clone failed, check your network or branch name"
fi
fi
diff --git a/xmake/actions/update/main.lua b/xmake/actions/update/main.lua
index 7553878b2..f97df2291 100644
--- a/xmake/actions/update/main.lua
+++ b/xmake/actions/update/main.lua
@@ -484,7 +484,7 @@ function main()
http.download(url, installerfile)
end
else
- git.clone(url, {treeless = true, recurse_submodules = not script_only, branch = version, outputdir = sourcedir})
+ git.clone(url, {depth = 1, recurse_submodules = not script_only, branch = version, outputdir = sourcedir})
end
return true
end,
diff --git a/xmake/modules/package/manager/conan/v1/install_package.lua b/xmake/modules/package/manager/conan/v1/install_package.lua
index 044cb18d1..3475a21b3 100644
--- a/xmake/modules/package/manager/conan/v1/install_package.lua
+++ b/xmake/modules/package/manager/conan/v1/install_package.lua
@@ -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, {treeless = true, branch = "0.1.0/testing", outputdir = xmake_generator_localdir}); return true end }
+ ok = try { function () git.clone(url, {depth = 1, branch = "0.1.0/testing", outputdir = xmake_generator_localdir}); return true end }
if ok then
break
end
diff --git a/xmake/modules/private/action/require/impl/actions/download.lua b/xmake/modules/private/action/require/impl/actions/download.lua
index 77bd4c55b..fc3045aa2 100644
--- a/xmake/modules/private/action/require/impl/actions/download.lua
+++ b/xmake/modules/private/action/require/impl/actions/download.lua
@@ -96,7 +96,7 @@ function _checkout(package, url, sourcedir, opt)
end
-- only shallow clone this branch
- git.clone(url, {treeless = true, recursive = true, shallow_submodules = true, longpaths = longpaths, branch = branch, outputdir = packagedir})
+ git.clone(url, {depth = 1, recursive = true, shallow_submodules = true, longpaths = longpaths, branch = branch, outputdir = packagedir})
-- download package from revision or tag?
else
@@ -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, {treeless = true, recursive = true, shallow_submodules = true, longpaths = longpaths, branch = tag, outputdir = packagedir})
+ git.clone(url, {depth = 1, recursive = true, shallow_submodules = true, longpaths = longpaths, branch = tag, outputdir = packagedir})
else
-- clone whole history and tags
diff --git a/xmake/modules/private/utils/statistics.lua b/xmake/modules/private/utils/statistics.lua
index 8273d7af2..6ebe20c13 100644
--- a/xmake/modules/private/utils/statistics.lua
+++ b/xmake/modules/private/utils/statistics.lua
@@ -121,7 +121,7 @@ function main()
{
function ()
import("devel.git.clone")
- clone("https://github.com/xmake-io/xmake-stats.git", {treeless = true, branch = "master", outputdir = outputdir})
+ clone("https://github.com/xmake-io/xmake-stats.git", {depth = 1, branch = "master", outputdir = outputdir})
print("post to traffic ok!")
end
}