int rebase(const char *onto_str)
{
git_rebase_options opts = GIT_REBASE_OPTIONS_INIT;
git_repository_head(&head, repo);
git_annotated_commit_from_ref(&branch, repo, head);
git_branch_lookup(&ref, repo, onto_str, GIT_BRANCH_LOCAL);
git_annotated_commit_from_ref(&onto, repo, ref);
git_rebase_init(&rebase, repo, branch, 0, onto, &opts);
while ((rc = git_rebase_next(&op, rebase)) == 0)
printf("%d
", rc);
printf("%d
", rc);
}
While on branch "new" I do rebase master and get output
0
-13
Reference "new" now 7fe5cbd and working dir contain changes from 70d5af.
What's wrong? Branch "new" only change one file and "master" change another
question from:
https://stackoverflow.com/questions/65887614/rebase-using-libgit2 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…