Commit e871d89b by Ben Straub

Ensure moving a branch updates the reflog

parent ccf6ce5c
......@@ -186,3 +186,22 @@ void test_refs_branches_move__moving_the_branch_pointed_at_by_HEAD_updates_HEAD(
cl_assert_equal_s("refs/heads/master2", git_reference_name(branch));
git_reference_free(branch);
}
void test_refs_branches_move__updates_the_reflog(void)
{
git_reference *branch;
git_reference *new_branch;
git_reflog *log;
const git_reflog_entry *entry;
cl_git_pass(git_reference_lookup(&branch, repo, "refs/heads/master"));
cl_git_pass(git_branch_move(&new_branch, branch, "master2", 0, NULL, "message"));
cl_git_pass(git_reflog_read(&log, repo, git_reference_name(new_branch)));
entry = git_reflog_entry_byindex(log, 0);
cl_assert_equal_s("message", git_reflog_entry_message(entry));
git_reference_free(branch);
git_reference_free(new_branch);
git_reflog_free(log);
}
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