summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@github.com>2016-04-26 11:48:11 -0400
committerEdward Thomson <ethomson@github.com>2016-04-26 11:49:05 -0400
commitb3ffd8f63840b2401fa2e636163512a8f0f17b47 (patch)
treed54daa7fe8a1899c37605dbc844978b09d336b32
parentcb2dfa46c8e12f60b20cdc80e1616c35d74c1b7e (diff)
downloadlibgit2-b3ffd8f63840b2401fa2e636163512a8f0f17b47.tar.gz
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.
-rw-r--r--tests/rebase/abort.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/rebase/abort.c b/tests/rebase/abort.c
index 70529521f..d8891fb1d 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;