summaryrefslogtreecommitdiff
path: root/xmake/modules/devel/git
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/modules/devel/git')
-rw-r--r--xmake/modules/devel/git/apply.lua5
-rw-r--r--xmake/modules/devel/git/branches.lua2
-rw-r--r--xmake/modules/devel/git/checkout.lua5
-rw-r--r--xmake/modules/devel/git/clean.lua5
-rw-r--r--xmake/modules/devel/git/clone.lua5
-rw-r--r--xmake/modules/devel/git/ls_remote.lua5
-rw-r--r--xmake/modules/devel/git/pull.lua5
-rw-r--r--xmake/modules/devel/git/submodule/update.lua5
-rw-r--r--xmake/modules/devel/git/tags.lua2
9 files changed, 7 insertions, 32 deletions
diff --git a/xmake/modules/devel/git/apply.lua b/xmake/modules/devel/git/apply.lua
index e47f31adc..c52aeeb3c 100644
--- a/xmake/modules/devel/git/apply.lua
+++ b/xmake/modules/devel/git/apply.lua
@@ -38,10 +38,7 @@ import("lib.detect.find_tool")
function main(patchfile, opt)
-- find git
- local git = find_tool("git")
- if not git then
- return
- end
+ local git = assert(find_tool("git"), "git not found!")
-- init argv
opt = opt or {}
diff --git a/xmake/modules/devel/git/branches.lua b/xmake/modules/devel/git/branches.lua
index f02ab851d..705d48153 100644
--- a/xmake/modules/devel/git/branches.lua
+++ b/xmake/modules/devel/git/branches.lua
@@ -37,7 +37,5 @@ import("ls_remote")
-- @endcode
--
function main(url)
-
- -- get branches
return ls_remote("heads", url)
end
diff --git a/xmake/modules/devel/git/checkout.lua b/xmake/modules/devel/git/checkout.lua
index 4a4c92bae..8fc62e66f 100644
--- a/xmake/modules/devel/git/checkout.lua
+++ b/xmake/modules/devel/git/checkout.lua
@@ -42,10 +42,7 @@ function main(commit, opt)
opt = opt or {}
-- find git
- local git = find_tool("git")
- if not git then
- return
- end
+ local git = assert(find_tool("git"), "git not found!")
-- init argv
local argv = {"checkout", commit}
diff --git a/xmake/modules/devel/git/clean.lua b/xmake/modules/devel/git/clean.lua
index 4ed39a20f..35f20a3d8 100644
--- a/xmake/modules/devel/git/clean.lua
+++ b/xmake/modules/devel/git/clean.lua
@@ -41,10 +41,7 @@ function main(opt)
opt = opt or {}
-- find git
- local git = find_tool("git")
- if not git then
- return
- end
+ local git = assert(find_tool("git"), "git not found!")
-- init argv
local argv = {"clean", "-d"}
diff --git a/xmake/modules/devel/git/clone.lua b/xmake/modules/devel/git/clone.lua
index 4a77abbf5..706148154 100644
--- a/xmake/modules/devel/git/clone.lua
+++ b/xmake/modules/devel/git/clone.lua
@@ -39,10 +39,7 @@ import("lib.detect.find_tool")
function main(url, opt)
-- find git
- local git = find_tool("git")
- if not git then
- return
- end
+ local git = assert(find_tool("git"), "git not found!")
-- init argv
local argv = {"clone", url}
diff --git a/xmake/modules/devel/git/ls_remote.lua b/xmake/modules/devel/git/ls_remote.lua
index e946a054a..723372bec 100644
--- a/xmake/modules/devel/git/ls_remote.lua
+++ b/xmake/modules/devel/git/ls_remote.lua
@@ -42,10 +42,7 @@ import("lib.detect.find_tool")
function main(reftype, url)
-- find git
- local git = find_tool("git")
- if not git then
- return
- end
+ local git = assert(find_tool("git"), "git not found!")
-- init reference type
reftype = reftype or "refs"
diff --git a/xmake/modules/devel/git/pull.lua b/xmake/modules/devel/git/pull.lua
index 4c274a70b..6be175bf9 100644
--- a/xmake/modules/devel/git/pull.lua
+++ b/xmake/modules/devel/git/pull.lua
@@ -41,10 +41,7 @@ function main(opt)
opt = opt or {}
-- find git
- local git = find_tool("git")
- if not git then
- return
- end
+ local git = assert(find_tool("git"), "git not found!")
-- init argv
local argv = {"pull"}
diff --git a/xmake/modules/devel/git/submodule/update.lua b/xmake/modules/devel/git/submodule/update.lua
index 403bf112d..c73880c0a 100644
--- a/xmake/modules/devel/git/submodule/update.lua
+++ b/xmake/modules/devel/git/submodule/update.lua
@@ -41,10 +41,7 @@ function main(opt)
opt = opt or {}
-- find git
- local git = find_tool("git")
- if not git then
- return
- end
+ local git = assert(find_tool("git"), "git not found!")
-- init argv
local argv = {"submodule", "update"}
diff --git a/xmake/modules/devel/git/tags.lua b/xmake/modules/devel/git/tags.lua
index 0d28af9e0..84a9a6df1 100644
--- a/xmake/modules/devel/git/tags.lua
+++ b/xmake/modules/devel/git/tags.lua
@@ -37,7 +37,5 @@ import("ls_remote")
-- @endcode
--
function main(url)
-
- -- get tags
return ls_remote("tags", url)
end