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.
diff --git a/tests/rebase/abort.c b/tests/rebase/abort.c
index 7052952..d8891fb 100644
--- a/tests/rebase/abort.c
+++ b/tests/rebase/abort.c
@@ -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;