summaryrefslogtreecommitdiff
path: root/xmake/modules/devel/git
diff options
context:
space:
mode:
authorruki <[email protected]>2022-10-30 11:24:34 +0800
committerruki <[email protected]>2022-10-30 11:24:34 +0800
commitfdff022d0732c24f8e2d8076896c2b44db03139b (patch)
tree937a701d85d408557a2279fde7349412cd70fa46 /xmake/modules/devel/git
parent441628171fac4ea543c1c87f66c533237c2067e4 (diff)
improve git fsmonitor
Diffstat (limited to 'xmake/modules/devel/git')
-rw-r--r--xmake/modules/devel/git/checkout.lua8
-rw-r--r--xmake/modules/devel/git/clean.lua7
-rw-r--r--xmake/modules/devel/git/clone.lua7
-rw-r--r--xmake/modules/devel/git/pull.lua7
-rw-r--r--xmake/modules/devel/git/push.lua12
-rw-r--r--xmake/modules/devel/git/reset.lua7
-rw-r--r--xmake/modules/devel/git/submodule/clean.lua7
-rw-r--r--xmake/modules/devel/git/submodule/reset.lua7
-rw-r--r--xmake/modules/devel/git/submodule/update.lua7
9 files changed, 50 insertions, 19 deletions
diff --git a/xmake/modules/devel/git/checkout.lua b/xmake/modules/devel/git/checkout.lua
index 65ea1e820..61919e422 100644
--- a/xmake/modules/devel/git/checkout.lua
+++ b/xmake/modules/devel/git/checkout.lua
@@ -40,10 +40,12 @@ function main(commit, opt)
opt = opt or {}
local git = assert(find_tool("git"), "git not found!")
local argv = {}
-
- if opt.fsmonitor ~= nil then
+ if opt.fsmonitor then
+ table.insert(argv, "-c")
+ table.insert(argv, "core.fsmonitor=true")
+ else
table.insert(argv, "-c")
- table.insert(argv, "core.fsmonitor=" .. tostring(opt.fsmonitor))
+ table.insert(argv, "core.fsmonitor=false")
end
table.insert(argv, "checkout")
diff --git a/xmake/modules/devel/git/clean.lua b/xmake/modules/devel/git/clean.lua
index 20265687b..91b6b5c82 100644
--- a/xmake/modules/devel/git/clean.lua
+++ b/xmake/modules/devel/git/clean.lua
@@ -45,9 +45,12 @@ function main(opt)
-- init argv
local argv = {}
- if opt.fsmonitor ~= nil then
+ if opt.fsmonitor then
table.insert(argv, "-c")
- table.insert(argv, "core.fsmonitor=" .. tostring(opt.fsmonitor))
+ 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")
diff --git a/xmake/modules/devel/git/clone.lua b/xmake/modules/devel/git/clone.lua
index f821b8b24..58f43462d 100644
--- a/xmake/modules/devel/git/clone.lua
+++ b/xmake/modules/devel/git/clone.lua
@@ -78,9 +78,12 @@ function main(url, opt)
end
-- set fsmonitor
- if opt.fsmonitor ~= nil then
+ if opt.fsmonitor then
table.insert(argv, "-c")
- table.insert(argv, "core.fsmonitor=" .. tostring(opt.fsmonitor))
+ table.insert(argv, "core.fsmonitor=true")
+ else
+ table.insert(argv, "-c")
+ table.insert(argv, "core.fsmonitor=false")
end
-- set outputdir
diff --git a/xmake/modules/devel/git/pull.lua b/xmake/modules/devel/git/pull.lua
index c5f1f6a55..a9923bb18 100644
--- a/xmake/modules/devel/git/pull.lua
+++ b/xmake/modules/devel/git/pull.lua
@@ -46,9 +46,12 @@ function main(opt)
-- init argv
local argv = {}
- if opt.fsmonitor ~= nil then
+ if opt.fsmonitor then
table.insert(argv, "-c")
- table.insert(argv, "core.fsmonitor=" .. tostring(opt.fsmonitor))
+ table.insert(argv, "core.fsmonitor=true")
+ else
+ table.insert(argv, "-c")
+ table.insert(argv, "core.fsmonitor=false")
end
table.insert(argv, "pull")
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 e9fbe6c30..ba1a0f139 100644
--- a/xmake/modules/devel/git/reset.lua
+++ b/xmake/modules/devel/git/reset.lua
@@ -45,9 +45,12 @@ function main(opt)
-- init argv
local argv = {}
- if opt.fsmonitor ~= nil then
+ if opt.fsmonitor then
table.insert(argv, "-c")
- table.insert(argv, "core.fsmonitor=" .. tostring(opt.fsmonitor))
+ table.insert(argv, "core.fsmonitor=true")
+ else
+ table.insert(argv, "-c")
+ table.insert(argv, "core.fsmonitor=false")
end
table.insert(argv, "reset")
diff --git a/xmake/modules/devel/git/submodule/clean.lua b/xmake/modules/devel/git/submodule/clean.lua
index c1817257c..622dff3e7 100644
--- a/xmake/modules/devel/git/submodule/clean.lua
+++ b/xmake/modules/devel/git/submodule/clean.lua
@@ -45,9 +45,12 @@ function main(opt)
-- init argv
local argv = {}
- if opt.fsmonitor ~= nil then
+ if opt.fsmonitor then
table.insert(argv, "-c")
- table.insert(argv, "core.fsmonitor=" .. tostring(opt.fsmonitor))
+ 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")
diff --git a/xmake/modules/devel/git/submodule/reset.lua b/xmake/modules/devel/git/submodule/reset.lua
index 1095310e7..e0c7bf98d 100644
--- a/xmake/modules/devel/git/submodule/reset.lua
+++ b/xmake/modules/devel/git/submodule/reset.lua
@@ -45,9 +45,12 @@ function main(opt)
-- init argv
local argv = {}
- if opt.fsmonitor ~= nil then
+ if opt.fsmonitor then
table.insert(argv, "-c")
- table.insert(argv, "core.fsmonitor=" .. tostring(opt.fsmonitor))
+ 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")
diff --git a/xmake/modules/devel/git/submodule/update.lua b/xmake/modules/devel/git/submodule/update.lua
index d81495a88..ee24bffcf 100644
--- a/xmake/modules/devel/git/submodule/update.lua
+++ b/xmake/modules/devel/git/submodule/update.lua
@@ -45,9 +45,12 @@ function main(opt)
-- init argv
local argv = {}
- if opt.fsmonitor ~= nil then
+ if opt.fsmonitor then
table.insert(argv, "-c")
- table.insert(argv, "core.fsmonitor=" .. tostring(opt.fsmonitor))
+ 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")