diff options
| author | Ângelo Andrade Cirino <[email protected]> | 2022-01-10 10:23:17 -0300 |
|---|---|---|
| committer | Ângelo Andrade Cirino <[email protected]> | 2022-01-10 10:23:17 -0300 |
| commit | ed0c0c5e0249aa966ea7061b30710abdd0b09d87 (patch) | |
| tree | 2a51c869a3aea1a093ed569e749bdf0465634a6c /xmake/modules/devel/git/submodule/update.lua | |
| parent | 885d00da8caf74aeed758d030b9a1b50d9078e1f (diff) | |
| parent | 2431dd7e6142ff98b55741cfd4de4d2e69f4f8b5 (diff) | |
Merged from upstream/master
Diffstat (limited to 'xmake/modules/devel/git/submodule/update.lua')
| -rw-r--r-- | xmake/modules/devel/git/submodule/update.lua | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/xmake/modules/devel/git/submodule/update.lua b/xmake/modules/devel/git/submodule/update.lua index 5d9323a02..511684c1c 100644 --- a/xmake/modules/devel/git/submodule/update.lua +++ b/xmake/modules/devel/git/submodule/update.lua @@ -58,37 +58,26 @@ function main(opt) table.join2(argv, opt.paths) end - -- enter repository directory - local oldir = nil - if opt.repodir then - oldir = os.cd(opt.repodir) - end - -- enable long paths local longpaths_old local longpaths_changed = false if opt.longpaths then - local longpaths_old = try {function () return os.iorunv(git.program, {"config", "--get", "--global", "core.longpaths"}) end} + local longpaths_old = try {function () return os.iorunv(git.program, {"config", "--get", "--global", "core.longpaths"}, {curdir = opt.repodir}) end} if not longpaths_old or not longpaths_old:find("true") then - os.vrunv(git.program, {"config", "--global", "core.longpaths", "true"}) + os.vrunv(git.program, {"config", "--global", "core.longpaths", "true"}, {curdir = opt.repodir}) longpaths_changed = true end end -- submodule it - os.vrunv(git.program, argv) + os.vrunv(git.program, argv, {curdir = opt.repodir}) -- restore old long paths configuration if longpaths_changed then if longpaths_old and longpaths_old:find("false") then - os.vrunv(git.program, {"config", "--global", "core.longpaths", "false"}) + os.vrunv(git.program, {"config", "--global", "core.longpaths", "false"}, {curdir = opt.repodir}) else - os.vrunv(git.program, {"config", "--global", "--unset", "core.longpaths"}) + os.vrunv(git.program, {"config", "--global", "--unset", "core.longpaths"}, {curdir = opt.repodir}) end end - - -- leave repository directory - if oldir then - os.cd(oldir) - end end |
