summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-11-02 22:20:29 +0800
committerGitHub <[email protected]>2022-11-02 22:20:29 +0800
commit60b8a7e7b06b4f964c07a8e784832883c3073a83 (patch)
tree7db2851eec833d9a40b6a4c9993d16ac9ea39118
parent927a7250d758364835b5a051e974815ee7729b56 (diff)
parentfdff022d0732c24f8e2d8076896c2b44db03139b (diff)
Merge pull request #2999 from xmake-io/fsmonitor
Disable git fsmonitor #2902
-rw-r--r--xmake/modules/devel/git/checkout.lua12
-rw-r--r--xmake/modules/devel/git/clean.lua11
-rw-r--r--xmake/modules/devel/git/clone.lua9
-rw-r--r--xmake/modules/devel/git/pull.lua10
-rw-r--r--xmake/modules/devel/git/push.lua12
-rw-r--r--xmake/modules/devel/git/reset.lua10
-rw-r--r--xmake/modules/devel/git/submodule/clean.lua10
-rw-r--r--xmake/modules/devel/git/submodule/reset.lua10
-rw-r--r--xmake/modules/devel/git/submodule/update.lua11
9 files changed, 86 insertions, 9 deletions
diff --git a/xmake/modules/devel/git/checkout.lua b/xmake/modules/devel/git/checkout.lua
index fb1a24e27..61919e422 100644
--- a/xmake/modules/devel/git/checkout.lua
+++ b/xmake/modules/devel/git/checkout.lua
@@ -39,6 +39,16 @@ import("lib.detect.find_tool")
function main(commit, opt)
opt = opt or {}
local git = assert(find_tool("git"), "git not found!")
- local argv = {"checkout", commit}
+ local argv = {}
+ if opt.fsmonitor then
+ table.insert(argv, "-c")
+ table.insert(argv, "core.fsmonitor=true")
+ else
+ table.insert(argv, "-c")
+ table.insert(argv, "core.fsmonitor=false")
+ end
+
+ table.insert(argv, "checkout")
+ table.insert(argv, commit)
os.vrunv(git.program, argv, {curdir = opt.repodir})
end
diff --git a/xmake/modules/devel/git/clean.lua b/xmake/modules/devel/git/clean.lua
index 52fa81a0b..91b6b5c82 100644
--- a/xmake/modules/devel/git/clean.lua
+++ b/xmake/modules/devel/git/clean.lua
@@ -44,7 +44,16 @@ function main(opt)
local git = assert(find_tool("git"), "git not found!")
-- init argv
- local argv = {"clean", "-d"}
+ local argv = {}
+ if opt.fsmonitor then
+ table.insert(argv, "-c")
+ table.insert(argv, "core.fsmonitor=true")
+ else
+ table.insert(argv, "-c")
+ table.insert(argv, "core.fsmonitor=false")
+ end
+ table.insert(argv, "clean")
+ table.insert(argv, "-d")
-- verbose?
if not option.get("verbose") then
diff --git a/xmake/modules/devel/git/clone.lua b/xmake/modules/devel/git/clone.lua
index 534ae8ac3..58f43462d 100644
--- a/xmake/modules/devel/git/clone.lua
+++ b/xmake/modules/devel/git/clone.lua
@@ -77,6 +77,15 @@ function main(url, opt)
table.insert(argv, "core.longpaths=true")
end
+ -- set fsmonitor
+ if opt.fsmonitor then
+ table.insert(argv, "-c")
+ table.insert(argv, "core.fsmonitor=true")
+ else
+ table.insert(argv, "-c")
+ table.insert(argv, "core.fsmonitor=false")
+ end
+
-- set outputdir
if opt.outputdir then
table.insert(argv, path.translate(opt.outputdir))
diff --git a/xmake/modules/devel/git/pull.lua b/xmake/modules/devel/git/pull.lua
index 412e6e757..a9923bb18 100644
--- a/xmake/modules/devel/git/pull.lua
+++ b/xmake/modules/devel/git/pull.lua
@@ -45,7 +45,15 @@ function main(opt)
local git = assert(find_tool("git"), "git not found!")
-- init argv
- local argv = {"pull"}
+ local argv = {}
+ if opt.fsmonitor then
+ table.insert(argv, "-c")
+ table.insert(argv, "core.fsmonitor=true")
+ else
+ table.insert(argv, "-c")
+ table.insert(argv, "core.fsmonitor=false")
+ end
+ table.insert(argv, "pull")
-- set remote
table.insert(argv, opt.remote or "origin")
diff --git a/xmake/modules/devel/git/push.lua b/xmake/modules/devel/git/push.lua
index b56ea4059..02585f020 100644
--- a/xmake/modules/devel/git/push.lua
+++ b/xmake/modules/devel/git/push.lua
@@ -39,8 +39,16 @@ import("branch", {alias = "git_branch"})
function main(url, opt)
opt = opt or {}
local git = assert(find_tool("git"), "git not found!")
-
- local argv = {"push", url}
+ local argv = {}
+ if opt.fsmonitor then
+ table.insert(argv, "-c")
+ table.insert(argv, "core.fsmonitor=true")
+ else
+ table.insert(argv, "-c")
+ table.insert(argv, "core.fsmonitor=false")
+ end
+ table.insert(argv, "push")
+ table.insert(argv, url)
if opt.force then
table.insert(argv, "--force")
end
diff --git a/xmake/modules/devel/git/reset.lua b/xmake/modules/devel/git/reset.lua
index 4ed798d25..ba1a0f139 100644
--- a/xmake/modules/devel/git/reset.lua
+++ b/xmake/modules/devel/git/reset.lua
@@ -44,7 +44,15 @@ function main(opt)
local git = assert(find_tool("git"), "git not found!")
-- init argv
- local argv = {"reset"}
+ local argv = {}
+ if opt.fsmonitor then
+ table.insert(argv, "-c")
+ table.insert(argv, "core.fsmonitor=true")
+ else
+ table.insert(argv, "-c")
+ table.insert(argv, "core.fsmonitor=false")
+ end
+ table.insert(argv, "reset")
-- verbose?
if not option.get("verbose") then
diff --git a/xmake/modules/devel/git/submodule/clean.lua b/xmake/modules/devel/git/submodule/clean.lua
index e21e2c6f1..622dff3e7 100644
--- a/xmake/modules/devel/git/submodule/clean.lua
+++ b/xmake/modules/devel/git/submodule/clean.lua
@@ -44,7 +44,15 @@ function main(opt)
local git = assert(find_tool("git"), "git not found!")
-- init argv
- local argv = {"submodule", "foreach", "--recursive", "git", "clean", "-d"}
+ local argv = {}
+ if opt.fsmonitor then
+ table.insert(argv, "-c")
+ table.insert(argv, "core.fsmonitor=true")
+ else
+ table.insert(argv, "-c")
+ table.insert(argv, "core.fsmonitor=false")
+ end
+ table.join2(argv, "submodule", "foreach", "--recursive", "git", "clean", "-d")
-- verbose?
if not option.get("verbose") then
diff --git a/xmake/modules/devel/git/submodule/reset.lua b/xmake/modules/devel/git/submodule/reset.lua
index f9dd01753..e0c7bf98d 100644
--- a/xmake/modules/devel/git/submodule/reset.lua
+++ b/xmake/modules/devel/git/submodule/reset.lua
@@ -44,7 +44,15 @@ function main(opt)
local git = assert(find_tool("git"), "git not found!")
-- init argv
- local argv = {"submodule", "foreach", "--recursive", "git", "reset"}
+ local argv = {}
+ if opt.fsmonitor then
+ table.insert(argv, "-c")
+ table.insert(argv, "core.fsmonitor=true")
+ else
+ table.insert(argv, "-c")
+ table.insert(argv, "core.fsmonitor=false")
+ end
+ table.join2(argv, "submodule", "foreach", "--recursive", "git", "reset")
-- verbose?
if not option.get("verbose") then
diff --git a/xmake/modules/devel/git/submodule/update.lua b/xmake/modules/devel/git/submodule/update.lua
index 511684c1c..ee24bffcf 100644
--- a/xmake/modules/devel/git/submodule/update.lua
+++ b/xmake/modules/devel/git/submodule/update.lua
@@ -44,7 +44,16 @@ function main(opt)
local git = assert(find_tool("git"), "git not found!")
-- init argv
- local argv = {"submodule", "update"}
+ local argv = {}
+ if opt.fsmonitor then
+ table.insert(argv, "-c")
+ table.insert(argv, "core.fsmonitor=true")
+ else
+ table.insert(argv, "-c")
+ table.insert(argv, "core.fsmonitor=false")
+ end
+ table.insert(argv, "submodule")
+ table.insert(argv, "update")
for _, name in ipairs({"init", "remote", "force", "checkout", "merge", "rebase", "recursive"}) do
if opt[name] then
table.insert(argv, "--" .. name)