Skip to content

Commit 228a8be

Browse files
committed
tests: deleting the branch under HEAD writes to its reflog
1 parent 178b591 commit 228a8be

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/refs/reflog/messages.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,19 @@ void test_refs_reflog_messages__commit_on_symbolic_ref_updates_head_reflog(void)
215215
git_tree_free(tree);
216216
}
217217

218+
void test_refs_reflog_messages__delete_checked_out_ref_updates_head_reflog(void)
219+
{
220+
git_reference *head, *current;
221+
222+
cl_git_pass(git_repository_head(&head, g_repo));
223+
cl_git_pass(git_reference_resolve(&current, head));
224+
225+
cl_git_pass(git_reference_delete(current));
226+
227+
cl_reflog_check_entry(g_repo, GIT_HEAD_FILE,
228+
0, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OID_HEX_ZERO, g_email, "");
229+
}
230+
218231
void test_refs_reflog_messages__show_merge_for_merge_commits(void)
219232
{
220233
git_oid b1_oid;

0 commit comments

Comments
 (0)