def merge_head(self, path, ref): try: repo = Jagare(path) ret = repo.merge_head(ref) return MergeResultConverter(**ret).convert() except Exception as e: raise ServiceUnavailable(repr(e))
def test_merge_head(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) merge_result = repo.merge_head(BR) assert merge_result['is_fastforward']