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
67c4716f
Commit
67c4716f
authored
Jan 27, 2014
by
Ben Straub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add passing reflog tests
parent
2952a9d0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
1 deletions
+29
-1
tests/refs/branches/create.c
+29
-1
No files found.
tests/refs/branches/create.c
View file @
67c4716f
...
@@ -66,7 +66,6 @@ void test_refs_branches_create__can_force_create_over_an_existing_branch(void)
...
@@ -66,7 +66,6 @@ void test_refs_branches_create__can_force_create_over_an_existing_branch(void)
cl_assert_equal_s
(
"refs/heads/br2"
,
git_reference_name
(
branch
));
cl_assert_equal_s
(
"refs/heads/br2"
,
git_reference_name
(
branch
));
}
}
void
test_refs_branches_create__creating_a_branch_with_an_invalid_name_returns_EINVALIDSPEC
(
void
)
void
test_refs_branches_create__creating_a_branch_with_an_invalid_name_returns_EINVALIDSPEC
(
void
)
{
{
retrieve_known_commit
(
&
target
,
repo
);
retrieve_known_commit
(
&
target
,
repo
);
...
@@ -75,3 +74,32 @@ void test_refs_branches_create__creating_a_branch_with_an_invalid_name_returns_E
...
@@ -75,3 +74,32 @@ void test_refs_branches_create__creating_a_branch_with_an_invalid_name_returns_E
git_branch_create
(
&
branch
,
repo
,
"inv@{id"
,
target
,
0
));
git_branch_create
(
&
branch
,
repo
,
"inv@{id"
,
target
,
0
));
}
}
void
test_refs_branches_create__creation_creates_new_reflog
(
void
)
{
git_reflog
*
log
;
const
git_reflog_entry
*
entry
;
retrieve_known_commit
(
&
target
,
repo
);
cl_git_pass
(
git_branch_create
(
&
branch
,
repo
,
NEW_BRANCH_NAME
,
target
,
false
));
cl_git_pass
(
git_reflog_read
(
&
log
,
repo
,
"refs/heads/"
NEW_BRANCH_NAME
));
cl_assert_equal_i
(
1
,
git_reflog_entrycount
(
log
));
entry
=
git_reflog_entry_byindex
(
log
,
0
);
}
void
test_refs_branches_create__recreation_updates_existing_reflog
(
void
)
{
git_reflog
*
log
;
const
git_reflog_entry
*
entry
;
retrieve_known_commit
(
&
target
,
repo
);
cl_git_pass
(
git_branch_create
(
&
branch
,
repo
,
NEW_BRANCH_NAME
,
target
,
false
));
cl_git_pass
(
git_branch_delete
(
branch
));
cl_git_pass
(
git_branch_create
(
&
branch
,
repo
,
NEW_BRANCH_NAME
,
target
,
false
));
cl_git_pass
(
git_reflog_read
(
&
log
,
repo
,
"refs/heads/"
NEW_BRANCH_NAME
));
cl_assert_equal_i
(
2
,
git_reflog_entrycount
(
log
));
entry
=
git_reflog_entry_byindex
(
log
,
0
);
}
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