Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
2952a9d0
Commit
2952a9d0
authored
Jan 27, 2014
by
Ben Straub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure creating HEAD creates its reflog
parent
6357388e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
0 deletions
+21
-0
tests/repo/head.c
+21
-0
No files found.
tests/repo/head.c
View file @
2952a9d0
...
...
@@ -217,3 +217,24 @@ void test_repo_head__setting_head_updates_reflog(void)
git_reflog_free
(
log
);
git_object_free
(
tag
);
}
void
test_repo_head__setting_creates_head_ref
(
void
)
{
git_reference
*
head
;
git_reflog
*
log
;
const
git_reflog_entry
*
entry
;
cl_git_pass
(
git_reference_lookup
(
&
head
,
repo
,
"HEAD"
));
cl_git_pass
(
git_reference_delete
(
head
));
cl_git_pass
(
git_reflog_delete
(
repo
,
"HEAD"
));
cl_git_pass
(
git_repository_set_head
(
repo
,
"refs/heads/haacked"
,
NULL
,
"create HEAD"
));
cl_git_pass
(
git_reflog_read
(
&
log
,
repo
,
"HEAD"
));
cl_assert_equal_i
(
1
,
git_reflog_entrycount
(
log
));
entry
=
git_reflog_entry_byindex
(
log
,
0
);
cl_assert_equal_s
(
"create HEAD"
,
git_reflog_entry_message
(
entry
));
git_reflog_free
(
log
);
git_reference_free
(
head
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment