From 7ef0d3eac5452a5c71f0ad9f7010d376c1f70e4c Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 18 Oct 2019 00:58:58 +0800 Subject: force to clone from the given branch --- xmake/actions/require/impl/action/download.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xmake/actions/require/impl/action/download.lua b/xmake/actions/require/impl/action/download.lua index ab586c4bc..a7b222009 100644 --- a/xmake/actions/require/impl/action/download.lua +++ b/xmake/actions/require/impl/action/download.lua @@ -47,7 +47,8 @@ function _checkout(package, url, sourcedir, url_alias) -- use previous source directory if exists local packagedir = path.join(sourcedir, package:name()) - if os.isdir(packagedir) then + if os.isdir(packagedir) and + not (option.get("force") and package:branch()) then -- we need disable cache if we force to clone from the given branch -- clean the previous build files git.clean({repodir = packagedir, force = true}) -- cgit v1.3.1