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
c0dd7122
Commit
c0dd7122
authored
Jun 06, 2019
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apply: add an options struct initializer
parent
0b5ba0d7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletions
+15
-1
include/git2/apply.h
+3
-1
src/apply.c
+7
-0
tests/core/structinit.c
+5
-0
No files found.
include/git2/apply.h
View file @
c0dd7122
...
...
@@ -57,7 +57,7 @@ typedef int GIT_CALLBACK(git_apply_hunk_cb)(
* Apply options structure
*
* Initialize with `GIT_APPLY_OPTIONS_INIT`. Alternatively, you can
* use `git_apply_
init_options
`.
* use `git_apply_
options_init
`.
*
* @see git_apply_to_tree, git_apply
*/
...
...
@@ -72,6 +72,8 @@ typedef struct {
#define GIT_APPLY_OPTIONS_VERSION 1
#define GIT_APPLY_OPTIONS_INIT {GIT_APPLY_OPTIONS_VERSION}
GIT_EXTERN
(
int
)
git_apply_options_init
(
git_apply_options
*
opts
,
unsigned
int
version
);
/**
* Apply a `git_diff` to a `git_tree`, and return the resulting image
* as an index.
...
...
src/apply.c
View file @
c0dd7122
...
...
@@ -745,6 +745,13 @@ done:
return
error
;
}
int
git_apply_options_init
(
git_apply_options
*
opts
,
unsigned
int
version
)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE
(
opts
,
version
,
git_apply_options
,
GIT_APPLY_OPTIONS_INIT
);
return
0
;
}
/*
* Handle the three application options ("locations"):
*
...
...
tests/core/structinit.c
View file @
c0dd7122
...
...
@@ -72,6 +72,11 @@ void test_core_structinit__compare(void)
clar__skip
();
#endif
/* apply */
CHECK_MACRO_FUNC_INIT_EQUAL
(
\
git_apply_options
,
GIT_APPLY_OPTIONS_VERSION
,
\
GIT_APPLY_OPTIONS_INIT
,
git_apply_options_init
);
/* blame */
CHECK_MACRO_FUNC_INIT_EQUAL
(
\
git_blame_options
,
GIT_BLAME_OPTIONS_VERSION
,
\
...
...
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