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
7a2e56a3
Commit
7a2e56a3
authored
Apr 29, 2014
by
Russell Belfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of redundant git_diff_options_init fn
Since git_diff_init_options was introduced, remove this old fn.
parent
b23b112d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
33 deletions
+2
-33
include/git2/diff.h
+0
-17
src/diff.c
+0
-14
tests/diff/blob.c
+1
-1
tests/diff/tree.c
+1
-1
No files found.
include/git2/diff.h
View file @
7a2e56a3
...
...
@@ -811,23 +811,6 @@ GIT_EXTERN(int) git_diff_find_similar(
git_diff
*
diff
,
const
git_diff_find_options
*
options
);
/**
* Initialize diff options structure
*
* In most cases, you can probably just use `GIT_DIFF_OPTIONS_INIT` to
* initialize the diff options structure, but in some cases that is not
* going to work. You can call this function instead. Note that you
* must pass both a pointer to the structure to be initialized and the
* `GIT_DIFF_OPTIONS_VERSION` value from the header you compiled with.
*
* @param options Pointer to git_diff_options memory to be initialized
* @param version Should be `GIT_DIFF_OPTIONS_VERSION`
* @return 0 on success, negative on failure (such as unsupported version)
*/
GIT_EXTERN
(
int
)
git_diff_options_init
(
git_diff_options
*
options
,
unsigned
int
version
);
/**@}*/
...
...
src/diff.c
View file @
7a2e56a3
...
...
@@ -1282,20 +1282,6 @@ int git_diff_tree_to_workdir_with_index(
return
error
;
}
int
git_diff_options_init
(
git_diff_options
*
options
,
unsigned
int
version
)
{
git_diff_options
template
=
GIT_DIFF_OPTIONS_INIT
;
if
(
version
!=
template
.
version
)
{
giterr_set
(
GITERR_INVALID
,
"Invalid version %d for git_diff_options"
,
(
int
)
version
);
return
-
1
;
}
memcpy
(
options
,
&
template
,
sizeof
(
*
options
));
return
0
;
}
size_t
git_diff_num_deltas
(
const
git_diff
*
diff
)
{
assert
(
diff
);
...
...
tests/diff/blob.c
View file @
7a2e56a3
...
...
@@ -26,7 +26,7 @@ void test_diff_blob__initialize(void)
g_repo
=
cl_git_sandbox_init
(
"attr"
);
cl_git_pass
(
git_diff_
options_init
(
&
opts
,
GIT_DIFF_OPTIONS_VERSION
));
cl_git_pass
(
git_diff_
init_options
(
&
opts
,
GIT_DIFF_OPTIONS_VERSION
));
opts
.
context_lines
=
1
;
memset
(
&
expected
,
0
,
sizeof
(
expected
));
...
...
tests/diff/tree.c
View file @
7a2e56a3
...
...
@@ -9,7 +9,7 @@ static diff_expects expect;
void
test_diff_tree__initialize
(
void
)
{
cl_git_pass
(
git_diff_
options_init
(
&
opts
,
GIT_DIFF_OPTIONS_VERSION
));
cl_git_pass
(
git_diff_
init_options
(
&
opts
,
GIT_DIFF_OPTIONS_VERSION
));
memset
(
&
expect
,
0
,
sizeof
(
expect
));
...
...
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