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
ef03d040
Commit
ef03d040
authored
Sep 20, 2013
by
Ben Straub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trim fat from git_blame struct
parent
a121e580
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1 additions
and
19 deletions
+1
-19
src/blame.c
+0
-11
src/blame.h
+0
-7
tests-clar/blame/getters.c
+1
-1
No files found.
src/blame.c
View file @
ef03d040
...
...
@@ -62,11 +62,6 @@ static git_blame_hunk* new_hunk(uint16_t start, uint16_t lines, uint16_t orig_st
return
hunk
;
}
git_blame_hunk
*
git_blame__alloc_hunk
()
{
return
new_hunk
(
0
,
0
,
0
,
NULL
);
}
static
git_blame_hunk
*
dup_hunk
(
git_blame_hunk
*
hunk
)
{
git_blame_hunk
*
newhunk
=
new_hunk
(
hunk
->
final_start_line_number
,
hunk
->
lines_in_hunk
,
hunk
->
orig_start_line_number
,
hunk
->
orig_path
);
...
...
@@ -106,13 +101,11 @@ git_blame* git_blame__alloc(
return
NULL
;
}
git_vector_init
(
&
gbr
->
hunks
,
8
,
hunk_sort_cmp_by_start_line
);
git_vector_init
(
&
gbr
->
unclaimed_hunks
,
8
,
hunk_sort_cmp_by_start_line
);
git_vector_init
(
&
gbr
->
paths
,
8
,
paths_cmp
);
gbr
->
repository
=
repo
;
gbr
->
options
=
opts
;
gbr
->
path
=
git__strdup
(
path
);
git_vector_insert
(
&
gbr
->
paths
,
git__strdup
(
path
));
gbr
->
final_blob
=
NULL
;
return
gbr
;
}
...
...
@@ -128,10 +121,6 @@ void git_blame_free(git_blame *blame)
free_hunk
(
hunk
);
git_vector_free
(
&
blame
->
hunks
);
git_vector_foreach
(
&
blame
->
unclaimed_hunks
,
i
,
hunk
)
free_hunk
(
hunk
);
git_vector_free
(
&
blame
->
unclaimed_hunks
);
git_vector_foreach
(
&
blame
->
paths
,
i
,
path
)
git__free
(
path
);
git_vector_free
(
&
blame
->
paths
);
...
...
src/blame.h
View file @
ef03d040
...
...
@@ -14,16 +14,11 @@ struct git_blame {
git_blame_options
options
;
git_vector
hunks
;
git_vector
unclaimed_hunks
;
git_vector
paths
;
git_blob
*
final_blob
;
size_t
num_lines
;
git_oid
current_commit
;
git_oid
parent_commit
;
size_t
current_diff_line
;
size_t
current_blame_line
;
git_blame_hunk
*
current_hunk
;
};
...
...
@@ -32,6 +27,4 @@ git_blame *git_blame__alloc(
git_blame_options
opts
,
const
char
*
path
);
git_blame_hunk
*
git_blame__alloc_hunk
();
#endif
tests-clar/blame/getters.c
View file @
ef03d040
...
...
@@ -20,7 +20,7 @@ void test_blame_getters__initialize(void)
g_blame
=
git_blame__alloc
(
NULL
,
opts
,
""
);
for
(
i
=
0
;
i
<
5
;
i
++
)
{
git_blame_hunk
*
h
=
git_
blame__alloc_hunk
(
);
git_blame_hunk
*
h
=
git_
_calloc
(
1
,
sizeof
(
git_blame_hunk
)
);
h
->
final_start_line_number
=
hunks
[
i
].
final_start_line_number
;
h
->
orig_path
=
git__strdup
(
hunks
[
i
].
orig_path
);
h
->
lines_in_hunk
=
hunks
[
i
].
lines_in_hunk
;
...
...
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