diff options
| author | stay <[email protected]> | 2025-03-26 16:20:50 +0800 |
|---|---|---|
| committer | stay <[email protected]> | 2025-04-06 08:46:19 +0800 |
| commit | cd6ace825c1401c7a17929fea56c7771dfc807ba (patch) | |
| tree | cef16ea8ebea211141760419a7005edb4e301e2d /xmake/modules/devel/git/clone.lua | |
| parent | 287680540de502ef8c8415923bf71b4009ae7c76 (diff) | |
add git.can_treeless()
Diffstat (limited to 'xmake/modules/devel/git/clone.lua')
| -rw-r--r-- | xmake/modules/devel/git/clone.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/xmake/modules/devel/git/clone.lua b/xmake/modules/devel/git/clone.lua index 27e8e49b1..018e6fcef 100644 --- a/xmake/modules/devel/git/clone.lua +++ b/xmake/modules/devel/git/clone.lua @@ -52,6 +52,20 @@ function can_shallow_submodules() return can or false end +-- can clone with --filter=tree:0? +-- @see https://github.com/xmake-io/xmake/issues/6246 +function can_treeless() + local can = _g.can_treeless + if can == nil then + local git = assert(find_tool("git", {version = true}), "git not found!") + if git.version and semver.compare(git.version, "2.16.0") >= 0 then + can = true + end + _g.can_treeless = can or false + end + return can or false +end + -- clone url -- -- @param url the git url |
