build-pkg: merge "resolves" conflicts

Result of build by previous commit:
https://gist.github.com/32309209c467853deedc

If a conflict happens, build-pkg should "resolve" it by selecting
one of versions. Git has a merge strategy "recursive" with an
option "ours" which does exactly what is needed but works only
for two heads. That is why multi-merge was replaced by multiple
merges of two heads.
pull/1191/head
Boris Nagaev 9 years ago
parent d31bdd48b5
commit e464f12cd0

@ -362,17 +362,13 @@ local function gitCheckout(new_branch, deps)
end
local cmd = '%s checkout -q -b %s %s'
os.execute(cmd:format(GIT, new_branch, main_dep))
if #deps > 1 then
-- merge with other dependencies
local merged = {}
for i = 2, #deps do
table.insert(merged, itemToBranch(deps[i]))
end
local message = 'Merge ' .. table.concat(deps, ', ')
local cmd2 = '%s %s merge -q %s -m %q'
-- merge with other dependencies
for i = 2, #deps do
local message = 'Merge with ' .. deps[i]
local cmd2 = '%s %s merge -q -s recursive -X ours %s -m %q'
os.execute(cmd2:format(GIT,
GIT_USER,
table.concat(merged, ' '),
itemToBranch(deps[i]),
message))
end
end

Loading…
Cancel
Save