def merge_commits(self, path, ours, theirs): try: repo = Jagare(path) ret = repo.merge_tree(ours, theirs) return MergeIndexConverter(**ret).convert() except Exception as e: raise ServiceUnavailable(repr(e))
def test_merge_tree(self): repo = Jagare(self.path) BR = 'br_test_merge' path = self.get_temp_path() # repo has work-tree repo.clone(path, branch=BARE_REPO_OTHER_BRANCH) repo = Jagare(os.path.join(path, '.git')) ret = repo.create_branch(BR, BARE_REPO_OTHER_BRANCH) assert ret commit_something(path, branch=BR) repo.update_head(BARE_REPO_OTHER_BRANCH) index = repo.merge_tree(repo.head.target.hex, BR) assert index['has_conflicts'] == False