diff options
| author | ruki <[email protected]> | 2024-03-01 00:46:39 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-03-01 00:46:39 +0800 |
| commit | 95029452b5b1ebf71986a6bd2d2d45f459861c19 (patch) | |
| tree | 4fa6e1d52e6ec449b59e4000963379ab33662be6 /xmake/modules | |
| parent | bde783984522a9e239e890f3cc1a1efef3a3efb3 (diff) | |
support reserve patch
Diffstat (limited to 'xmake/modules')
| -rw-r--r-- | xmake/modules/devel/git/apply.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/modules/devel/git/apply.lua b/xmake/modules/devel/git/apply.lua index 5934da380..92fbfb671 100644 --- a/xmake/modules/devel/git/apply.lua +++ b/xmake/modules/devel/git/apply.lua @@ -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 |
