summaryrefslogtreecommitdiff
path: root/xmake/modules/devel/git/apply.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/modules/devel/git/apply.lua')
-rw-r--r--xmake/modules/devel/git/apply.lua13
1 files changed, 1 insertions, 12 deletions
diff --git a/xmake/modules/devel/git/apply.lua b/xmake/modules/devel/git/apply.lua
index 97923da02..ccfd5bf80 100644
--- a/xmake/modules/devel/git/apply.lua
+++ b/xmake/modules/devel/git/apply.lua
@@ -44,17 +44,6 @@ function main(patchfile, opt)
opt = opt or {}
local argv = {"apply", "--reject", "--ignore-whitespace", patchfile}
- -- enter repository directory
- local oldir = nil
- if opt.repodir then
- oldir = os.cd(opt.repodir)
- end
-
-- apply it
- os.vrunv(git.program, argv)
-
- -- leave repository directory
- if oldir then
- os.cd(oldir)
- end
+ os.vrunv(git.program, argv, {curdir = opt.repodir})
end