summaryrefslogtreecommitdiff
path: root/xmake/modules/devel/git/apply.lua
diff options
context:
space:
mode:
authorallen <[email protected]>2023-11-03 21:39:57 +0800
committerallen <[email protected]>2023-11-03 22:36:33 +0800
commit747a37bc63bedf5a67dbf73922419eca23c3e9b0 (patch)
treede573ad76a2407cee3f6b44228bef13b4d7a7f30 /xmake/modules/devel/git/apply.lua
parent0f6e9d8f999137b5704299d0ed99ee42193ee55e (diff)
fix skipped patch if source package no git index
Diffstat (limited to 'xmake/modules/devel/git/apply.lua')
-rw-r--r--xmake/modules/devel/git/apply.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/xmake/modules/devel/git/apply.lua b/xmake/modules/devel/git/apply.lua
index b5f59ab49..5934da380 100644
--- a/xmake/modules/devel/git/apply.lua
+++ b/xmake/modules/devel/git/apply.lua
@@ -39,5 +39,8 @@ function main(patchfile, opt)
opt = opt or {}
local git = assert(find_tool("git"), "git not found!")
local argv = {"apply", "--reject", "--ignore-whitespace", patchfile}
+ if opt.gitdir then
+ table.insert(argv, 1, "--git-dir=" .. opt.gitdir)
+ end
os.vrunv(git.program, argv, {curdir = opt.repodir})
end