diff options
| author | ruki <[email protected]> | 2020-04-07 23:09:50 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-04-07 12:59:05 +0800 |
| commit | 20b25b2a16d0282b0496f23d0f0e1ba8842b9205 (patch) | |
| tree | c358ca5f0290e88fde95364d42281e40cf67e664 /xmake/modules/devel/git | |
| parent | 1e491924ccad666ad42e30d30e2031662bc1d3d0 (diff) | |
remove some ifelse
Diffstat (limited to 'xmake/modules/devel/git')
| -rw-r--r-- | xmake/modules/devel/git/clone.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/devel/git/ls_remote.lua | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/xmake/modules/devel/git/clone.lua b/xmake/modules/devel/git/clone.lua index b8fca2b48..4285b392d 100644 --- a/xmake/modules/devel/git/clone.lua +++ b/xmake/modules/devel/git/clone.lua @@ -54,7 +54,7 @@ function main(url, opt) -- set depth if opt.depth then table.insert(argv, "--depth") - table.insert(argv, ifelse(type(opt.depth) == "number", tostring(opt.depth), opt.depth)) + table.insert(argv, type(opt.depth) == "number" and tostring(opt.depth) or opt.depth) end -- recursive? diff --git a/xmake/modules/devel/git/ls_remote.lua b/xmake/modules/devel/git/ls_remote.lua index 9b87fdf3f..a52e0d68d 100644 --- a/xmake/modules/devel/git/ls_remote.lua +++ b/xmake/modules/devel/git/ls_remote.lua @@ -72,7 +72,7 @@ function main(reftype, url) local ref = refinfo[2] -- save this ref - local prefix = ifelse(reftype == "refs", "refs/", "refs/" .. reftype .. "/") + local prefix = reftype == "refs" and "refs/" or ("refs/" .. reftype .. "/") if ref and ref:startswith(prefix) and commit and #commit == 40 then table.insert(refs, ref:sub(#prefix + 1)) end |
