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
0276f0f5
Commit
0276f0f5
authored
Feb 26, 2014
by
Juan Rubén
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reset num_parents to 1 only for merge commits
Also, correct test case to account for the boundary flag
parent
899bd19a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
src/blame_git.c
+1
-1
tests/blame/simple.c
+1
-1
No files found.
src/blame_git.c
View file @
0276f0f5
...
...
@@ -489,7 +489,7 @@ static void pass_blame(git_blame *blame, git_blame__origin *origin, uint32_t opt
if
(
!
git_oid_cmp
(
git_commit_id
(
commit
),
&
blame
->
options
.
oldest_commit
))
/* Stop at oldest specified commit */
num_parents
=
0
;
else
if
(
opt
&
GIT_BLAME_FIRST_PARENT
)
else
if
(
opt
&
GIT_BLAME_FIRST_PARENT
&&
num_parents
>
1
)
/* Limit search to the first parent */
num_parents
=
1
;
...
...
tests/blame/simple.c
View file @
0276f0f5
...
...
@@ -314,7 +314,7 @@ void test_blame_simple__can_restrict_to_first_parent_commits(void)
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
,
1
,
5
,
1
,
1
,
"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