Skip to content

Commit 6c18ac9

Browse files
committed
ifcgit: use --prioritise-local flag for ifcmerge-forward mergetool
1 parent 9d42f4c commit 6c18ac9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/bonsai/bonsai/tool/ifcgit.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,15 @@ def config_ifcmerge(cls) -> None:
473473
config_writer.set_value(section, "cmd", "ifcmerge $BASE $LOCAL $REMOTE $MERGED")
474474
config_writer.set_value(section, "trustExitCode", True)
475475
section = 'mergetool "ifcmerge-forward"'
476+
new_cmd = "ifcmerge --prioritise-local $BASE $LOCAL $REMOTE $MERGED"
477+
old_cmd = "ifcmerge $BASE $REMOTE $LOCAL $MERGED"
476478
if not config_reader.has_section(section):
477479
with IfcGitRepo.repo.config_writer() as config_writer:
478-
config_writer.set_value(section, "cmd", "ifcmerge $BASE $REMOTE $LOCAL $MERGED")
480+
config_writer.set_value(section, "cmd", new_cmd)
479481
config_writer.set_value(section, "trustExitCode", True)
482+
elif config_reader.get_value(section, "cmd") == old_cmd:
483+
with IfcGitRepo.repo.config_writer() as config_writer:
484+
config_writer.set_value(section, "cmd", new_cmd)
480485

481486
@classmethod
482487
def config_push(cls, repo: git.Repo) -> None:

0 commit comments

Comments
 (0)