summaryrefslogtreecommitdiff
path: root/tests/rebase/merge.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2014-07-18 18:22:54 -0400
committerEdward Thomson <ethomson@microsoft.com>2014-10-26 22:59:27 -0400
commita612a25fa673447e874407fd2d9501998885d392 (patch)
tree57883d4a2ba332246cb0a475c7d0607f091ac72e /tests/rebase/merge.c
parent517644cce4df8ac9ea40669dd22574d6dc76c02f (diff)
downloadlibgit2-a612a25fa673447e874407fd2d9501998885d392.tar.gz
git_rebase_commit: write HEAD's reflog appropriately
Diffstat (limited to 'tests/rebase/merge.c')
-rw-r--r--tests/rebase/merge.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/rebase/merge.c b/tests/rebase/merge.c
index fa37e89e6..0d4dca489 100644
--- a/tests/rebase/merge.c
+++ b/tests/rebase/merge.c
@@ -178,6 +178,8 @@ void test_rebase_merge__commit(void)
git_oid commit_id, tree_id, parent_id;
git_signature *author;
git_commit *commit;
+ git_reflog *reflog;
+ const git_reflog_entry *reflog_entry;
checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE;
@@ -211,8 +213,14 @@ void test_rebase_merge__commit(void)
cl_assert(git_signature__equal(signature, git_commit_committer(commit)));
- cl_assert_equal_file("da9c51a23d02d931a486f45ad18cda05cf5d2b94 776e4c48922799f903f03f5f6e51da8b01e4cce0\n", 82, "rebase/.git/rebase-merge/rewritten");
+ /* Make sure the reflogs are updated appropriately */
+ cl_git_pass(git_reflog_read(&reflog, repo, "HEAD"));
+ cl_assert(reflog_entry = git_reflog_entry_byindex(reflog, 0));
+ cl_assert_equal_oid(&parent_id, git_reflog_entry_id_old(reflog_entry));
+ cl_assert_equal_oid(&commit_id, git_reflog_entry_id_new(reflog_entry));
+ cl_assert_equal_s("rebase: Modification 1 to beef", git_reflog_entry_message(reflog_entry));
+ git_reflog_free(reflog);
git_signature_free(author);
git_commit_free(commit);
git_merge_head_free(branch_head);