diff options
Diffstat (limited to 'xmake/modules/devel/git/clone.lua')
| -rw-r--r-- | xmake/modules/devel/git/clone.lua | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/xmake/modules/devel/git/clone.lua b/xmake/modules/devel/git/clone.lua index 58f43462d..469d36c2e 100644 --- a/xmake/modules/devel/git/clone.lua +++ b/xmake/modules/devel/git/clone.lua @@ -20,9 +20,24 @@ -- imports import("core.base.option") +import("core.base.semver") import("lib.detect.find_tool") import("net.proxy") +-- can clone tag? +-- @see https://github.com/xmake-io/xmake/issues/4151 +function can_clone_tag() + local can = _g.can_clone_tag + if can == nil then + local git = assert(find_tool("git", {version = true}), "git not found!") + if git.version and semver.compare(git.version, "1.7.10") >= 0 then + can = true + end + _g.can_clone_tag = can or false + end + return can or false +end + -- clone url -- -- @param url the git url |
