mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-06 12:49:25 +00:00
Ensure moving a branch updates the reflog
This commit is contained in:
parent
ccf6ce5c89
commit
e871d89b28
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user