Skip to content

Commit b3ffd8f

Browse files
author
Edward Thomson
committed
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.
1 parent cb2dfa4 commit b3ffd8f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/rebase/abort.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,25 @@ void test_rebase_abort__merge_by_id(void)
145145
git_rebase_free(rebase);
146146
}
147147

148+
void test_rebase_abort__merge_by_revspec(void)
149+
{
150+
git_rebase *rebase;
151+
git_annotated_commit *branch_head, *onto_head;
152+
153+
cl_git_pass(git_annotated_commit_from_revspec(&branch_head, repo, "b146bd7"));
154+
cl_git_pass(git_annotated_commit_from_revspec(&onto_head, repo, "efad0b1"));
155+
156+
cl_git_pass(git_rebase_init(&rebase, repo, branch_head, NULL, onto_head, NULL));
157+
cl_assert_equal_i(GIT_REPOSITORY_STATE_REBASE_MERGE, git_repository_state(repo));
158+
159+
test_abort(branch_head, onto_head);
160+
161+
git_annotated_commit_free(branch_head);
162+
git_annotated_commit_free(onto_head);
163+
164+
git_rebase_free(rebase);
165+
}
166+
148167
void test_rebase_abort__merge_by_id_immediately_after_init(void)
149168
{
150169
git_rebase *rebase;

0 commit comments

Comments
 (0)