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/pull.lua | |
| parent | 885d00da8caf74aeed758d030b9a1b50d9078e1f (diff) | |
| parent | 2431dd7e6142ff98b55741cfd4de4d2e69f4f8b5 (diff) | |
Merged from upstream/master
Diffstat (limited to 'xmake/modules/devel/git/pull.lua')
| -rw-r--r-- | xmake/modules/devel/git/pull.lua | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/xmake/modules/devel/git/pull.lua b/xmake/modules/devel/git/pull.lua index 9970f8dbc..412e6e757 100644 --- a/xmake/modules/devel/git/pull.lua +++ b/xmake/modules/devel/git/pull.lua @@ -58,18 +58,12 @@ function main(opt) table.insert(argv, "--tags") end - -- enter repository directory - local oldir = nil - if opt.repodir then - oldir = os.cd(opt.repodir) - end - -- use proxy? local envs local proxy_conf = proxy.config() if proxy_conf then -- get proxy configuration from the current remote url - local remoteinfo = try { function() return os.iorunv(git.program, {"remote", "-v"}) end } + local remoteinfo = try { function() return os.iorunv(git.program, {"remote", "-v"}, {curdir = opt.repodir}) end } if remoteinfo then for _, line in ipairs(remoteinfo:split('\n', {plain = true})) do local splitinfo = line:split("%s+") @@ -86,10 +80,5 @@ function main(opt) end -- pull it - os.vrunv(git.program, argv, {envs = envs}) - - -- leave repository directory - if oldir then - os.cd(oldir) - end + os.vrunv(git.program, argv, {envs = envs, curdir = opt.repodir}) end |
