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
9e3b901a
Commit
9e3b901a
authored
Feb 24, 2014
by
Juan Rubén
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add unit test
parent
c7c83394
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
tests/blame/simple.c
+15
-0
No files found.
tests/blame/simple.c
View file @
9e3b901a
...
...
@@ -303,3 +303,18 @@ void test_blame_simple__can_restrict_to_newish_commits(void)
check_blame_hunk_index
(
g_repo
,
g_blame
,
0
,
1
,
1
,
1
,
"be3563a"
,
"branch_file.txt"
);
check_blame_hunk_index
(
g_repo
,
g_blame
,
1
,
2
,
1
,
0
,
"a65fedf"
,
"branch_file.txt"
);
}
void
test_blame_simple__can_restrict_to_first_parent_commits
(
void
)
{
git_blame_options
opts
=
GIT_BLAME_OPTIONS_INIT
;
opts
.
flags
|=
GIT_BLAME_FIRST_PARENT
;
cl_git_pass
(
git_repository_open
(
&
g_repo
,
cl_fixture
(
"blametest.git"
)));
cl_git_pass
(
git_blame_file
(
&
g_blame
,
g_repo
,
"b.txt"
,
&
opts
));
cl_assert_equal_i
(
4
,
git_blame_get_hunk_count
(
g_blame
));
check_blame_hunk_index
(
g_repo
,
g_blame
,
0
,
1
,
4
,
0
,
"da237394"
,
"b.txt"
);
check_blame_hunk_index
(
g_repo
,
g_blame
,
1
,
5
,
1
,
0
,
"b99f7ac0"
,
"b.txt"
);
check_blame_hunk_index
(
g_repo
,
g_blame
,
2
,
6
,
5
,
0
,
"63d671eb"
,
"b.txt"
);
check_blame_hunk_index
(
g_repo
,
g_blame
,
3
,
11
,
5
,
0
,
"bc7c5ac2"
,
"b.txt"
);
}
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