Commit b3ffd8f6 by Edward Thomson

rebase::abort: test we can abort rebase by revspec

Test that we can properly abort a rebase when it is initialized by a
revspec.  This ensures that we do not conflate revspecs and refnames.
parent cb2dfa46
......@@ -145,6 +145,25 @@ void test_rebase_abort__merge_by_id(void)
git_rebase_free(rebase);
}
void test_rebase_abort__merge_by_revspec(void)
{
git_rebase *rebase;
git_annotated_commit *branch_head, *onto_head;
cl_git_pass(git_annotated_commit_from_revspec(&branch_head, repo, "b146bd7"));
cl_git_pass(git_annotated_commit_from_revspec(&onto_head, repo, "efad0b1"));
cl_git_pass(git_rebase_init(&rebase, repo, branch_head, NULL, onto_head, NULL));
cl_assert_equal_i(GIT_REPOSITORY_STATE_REBASE_MERGE, git_repository_state(repo));
test_abort(branch_head, onto_head);
git_annotated_commit_free(branch_head);
git_annotated_commit_free(onto_head);
git_rebase_free(rebase);
}
void test_rebase_abort__merge_by_id_immediately_after_init(void)
{
git_rebase *rebase;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment