小编Cox*_*989的帖子

Objective-Git Merge

我正在使用Objective-Git.我无法使用以下方法:

- (GTIndex *)merge:(GTTree *)otherTree ancestor:(GTTree *)ancestorTree error:(NSError **)error
Run Code Online (Sandbox Code Playgroud)

没有返回错误,但返回的索引为空,当它存在时,所有属性都为零.合并操作不会发生,我无法写出树,因为我无法获得尝试合并产生的索引.

有没有人设法使用目标git成功执行合并 - 如何?救命!

        GTBranch *branch1 = branches[0];
        GTCommit *commit1 = [branch1 targetCommitAndReturnError:NULL];
        GTOID *oid1 =  commit1.OID;
        GTTree *tree1 = commit1.tree;

        GTBranch *branch2 = branches[1];
        GTCommit *commit2 = [branch2 targetCommitAndReturnError:NULL];
        GTTree *tree2 = commit2.tree;
        GTOID *oid2 =  commit2.OID;

        GTRepository *repo = branch1.repository;

        NSError *error;
        GTCommit *ancestor = [repo mergeBaseBetweenFirstOID:oid1 secondOID:oid2 error:&error];
        if (error){
            NSLog(@"%@", error.description);
        }
        GTTree *ancTree = ancestor.tree;
        NSError *someError;
        NSLog(@"attempting merge into ""%@"" from ""%@"" with ancestor ""%@""", …
Run Code Online (Sandbox Code Playgroud)

git objective-c git-merge libgit2 objective-git

1
推荐指数
1
解决办法
278
查看次数

标签 统计

git ×1

git-merge ×1

libgit2 ×1

objective-c ×1

objective-git ×1