Skip to content

Commit

Permalink
support reserve patch
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Feb 29, 2024
1 parent bde7839 commit 9502945
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion xmake/modules/devel/git/apply.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@ import("lib.detect.find_tool")
function main(patchfile, opt)
opt = opt or {}
local git = assert(find_tool("git"), "git not found!")
local argv = {"apply", "--reject", "--ignore-whitespace", patchfile}
local argv = {"apply", "--reject", "--ignore-whitespace"}
if opt.reverse then
table.insert(argv, "-R")
end
if opt.gitdir then
table.insert(argv, 1, "--git-dir=" .. opt.gitdir)
end
table.insert(argv, patchfile)
os.vrunv(git.program, argv, {curdir = opt.repodir})
end

0 comments on commit 9502945

Please sign in to comment.