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
aa17c3c6
Commit
aa17c3c6
authored
Jan 03, 2014
by
Ben Straub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git_revert_opts -> git_revert_options
parent
6affd71f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
29 deletions
+29
-29
include/git2/revert.h
+9
-9
src/revert.c
+12
-12
tests/revert/workdir.c
+6
-6
tests/structinit/structinit.c
+2
-2
No files found.
include/git2/revert.h
View file @
aa17c3c6
...
...
@@ -28,22 +28,22 @@ typedef struct {
git_merge_tree_opts
merge_tree_opts
;
git_checkout_options
checkout_opts
;
}
git_revert_opts
;
}
git_revert_opt
ion
s
;
#define GIT_REVERT_OPTS_VERSION 1
#define GIT_REVERT_OPT
S_INIT {GIT_REVERT_OPT
S_VERSION, 0, GIT_MERGE_TREE_OPTS_INIT, GIT_CHECKOUT_OPTIONS_INIT}
#define GIT_REVERT_OPT
ION
S_VERSION 1
#define GIT_REVERT_OPT
IONS_INIT {GIT_REVERT_OPTION
S_VERSION, 0, GIT_MERGE_TREE_OPTS_INIT, GIT_CHECKOUT_OPTIONS_INIT}
/**
* Initializes a `git_revert_opts` with default values. Equivalent to
* creating an instance with GIT_REVERT_OPTS_INIT.
* Initializes a `git_revert_opt
ion
s` with default values. Equivalent to
* creating an instance with GIT_REVERT_OPT
ION
S_INIT.
*
* @param opts the `git_revert_opts` instance to initialize.
* @param opts the `git_revert_opt
ion
s` instance to initialize.
* @param version the version of the struct; you should pass
* `GIT_REVERT_OPTS_VERSION` here.
* `GIT_REVERT_OPT
ION
S_VERSION` here.
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN
(
int
)
git_revert_init_opts
(
git_revert_opts
*
opts
,
git_revert_opt
ion
s
*
opts
,
int
version
);
/**
...
...
@@ -80,7 +80,7 @@ int git_revert_commit(
GIT_EXTERN
(
int
)
git_revert
(
git_repository
*
repo
,
git_commit
*
commit
,
const
git_revert_opts
*
given_opts
);
const
git_revert_opt
ion
s
*
given_opts
);
/** @} */
GIT_END_DECL
...
...
src/revert.c
View file @
aa17c3c6
...
...
@@ -67,8 +67,8 @@ cleanup:
static
int
revert_normalize_opts
(
git_repository
*
repo
,
git_revert_opts
*
opts
,
const
git_revert_opts
*
given
,
git_revert_opt
ion
s
*
opts
,
const
git_revert_opt
ion
s
*
given
,
const
char
*
their_label
)
{
int
error
=
0
;
...
...
@@ -78,10 +78,10 @@ static int revert_normalize_opts(
GIT_UNUSED
(
repo
);
if
(
given
!=
NULL
)
memcpy
(
opts
,
given
,
sizeof
(
git_revert_opts
));
memcpy
(
opts
,
given
,
sizeof
(
git_revert_opt
ion
s
));
else
{
git_revert_opt
s
default_opts
=
GIT_REVERT_OPT
S_INIT
;
memcpy
(
opts
,
&
default_opts
,
sizeof
(
git_revert_opts
));
git_revert_opt
ions
default_opts
=
GIT_REVERT_OPTION
S_INIT
;
memcpy
(
opts
,
&
default_opts
,
sizeof
(
git_revert_opt
ion
s
));
}
if
(
!
opts
->
checkout_opts
.
checkout_strategy
)
...
...
@@ -166,9 +166,9 @@ done:
int
git_revert
(
git_repository
*
repo
,
git_commit
*
commit
,
const
git_revert_opts
*
given_opts
)
const
git_revert_opt
ion
s
*
given_opts
)
{
git_revert_opts
opts
;
git_revert_opt
ion
s
opts
;
git_reference
*
our_ref
=
NULL
;
git_commit
*
our_commit
=
NULL
;
char
commit_oidstr
[
GIT_OID_HEXSZ
+
1
];
...
...
@@ -179,7 +179,7 @@ int git_revert(
assert
(
repo
&&
commit
);
GITERR_CHECK_VERSION
(
given_opts
,
GIT_REVERT_OPT
S_VERSION
,
"git_revert_opt
s"
);
GITERR_CHECK_VERSION
(
given_opts
,
GIT_REVERT_OPT
IONS_VERSION
,
"git_revert_option
s"
);
if
((
error
=
git_repository__ensure_not_bare
(
repo
,
"revert"
))
<
0
)
return
error
;
...
...
@@ -219,13 +219,13 @@ done:
return
error
;
}
int
git_revert_init_opts
(
git_revert_opts
*
opts
,
int
version
)
int
git_revert_init_opts
(
git_revert_opt
ion
s
*
opts
,
int
version
)
{
if
(
version
!=
GIT_REVERT_OPTS_VERSION
)
{
giterr_set
(
GITERR_INVALID
,
"Invalid version %d for git_revert_opts"
,
version
);
if
(
version
!=
GIT_REVERT_OPT
ION
S_VERSION
)
{
giterr_set
(
GITERR_INVALID
,
"Invalid version %d for git_revert_opt
ion
s"
,
version
);
return
-
1
;
}
else
{
git_revert_opt
s
o
=
GIT_REVERT_OPT
S_INIT
;
git_revert_opt
ions
o
=
GIT_REVERT_OPTION
S_INIT
;
memcpy
(
opts
,
&
o
,
sizeof
(
o
));
return
0
;
}
...
...
tests/revert/workdir.c
View file @
aa17c3c6
...
...
@@ -347,7 +347,7 @@ void test_revert_workdir__conflict_use_ours(void)
{
git_commit
*
head
,
*
commit
;
git_oid
head_oid
,
revert_oid
;
git_revert_opt
s
opts
=
GIT_REVERT_OPT
S_INIT
;
git_revert_opt
ions
opts
=
GIT_REVERT_OPTION
S_INIT
;
struct
merge_index_entry
merge_index_entries
[]
=
{
{
0100644
,
"caf99de3a49827117bb66721010eac461b06a80c"
,
0
,
"file1.txt"
},
...
...
@@ -387,7 +387,7 @@ void test_revert_workdir__rename_1_of_2(void)
{
git_commit
*
head
,
*
commit
;
git_oid
head_oid
,
revert_oid
;
git_revert_opt
s
opts
=
GIT_REVERT_OPT
S_INIT
;
git_revert_opt
ions
opts
=
GIT_REVERT_OPTION
S_INIT
;
struct
merge_index_entry
merge_index_entries
[]
=
{
{
0100644
,
"747726e021bc5f44b86de60e3032fd6f9f1b8383"
,
0
,
"file1.txt"
},
...
...
@@ -421,7 +421,7 @@ void test_revert_workdir__rename(void)
{
git_commit
*
head
,
*
commit
;
git_oid
head_oid
,
revert_oid
;
git_revert_opt
s
opts
=
GIT_REVERT_OPT
S_INIT
;
git_revert_opt
ions
opts
=
GIT_REVERT_OPTION
S_INIT
;
struct
merge_index_entry
merge_index_entries
[]
=
{
{
0100644
,
"55acf326a69f0aab7a974ec53ffa55a50bcac14e"
,
1
,
"file4.txt"
},
...
...
@@ -480,7 +480,7 @@ void test_revert_workdir__nonmerge_fails_mainline_specified(void)
{
git_reference
*
head
;
git_commit
*
commit
;
git_revert_opt
s
opts
=
GIT_REVERT_OPT
S_INIT
;
git_revert_opt
ions
opts
=
GIT_REVERT_OPTION
S_INIT
;
cl_git_pass
(
git_repository_head
(
&
head
,
repo
));
cl_git_pass
(
git_reference_peel
((
git_object
**
)
&
commit
,
head
,
GIT_OBJ_COMMIT
));
...
...
@@ -518,7 +518,7 @@ void test_revert_workdir__merge_first_parent(void)
{
git_commit
*
head
;
git_oid
head_oid
;
git_revert_opt
s
opts
=
GIT_REVERT_OPT
S_INIT
;
git_revert_opt
ions
opts
=
GIT_REVERT_OPTION
S_INIT
;
struct
merge_index_entry
merge_index_entries
[]
=
{
{
0100644
,
"296a6d3be1dff05c5d1f631d2459389fa7b619eb"
,
0
,
"file-mainline.txt"
},
...
...
@@ -543,7 +543,7 @@ void test_revert_workdir__merge_second_parent(void)
{
git_commit
*
head
;
git_oid
head_oid
;
git_revert_opt
s
opts
=
GIT_REVERT_OPT
S_INIT
;
git_revert_opt
ions
opts
=
GIT_REVERT_OPTION
S_INIT
;
struct
merge_index_entry
merge_index_entries
[]
=
{
{
0100644
,
"33c6fd981c49a2abf2971482089350bfc5cda8ea"
,
0
,
"file-branch.txt"
},
...
...
tests/structinit/structinit.c
View file @
aa17c3c6
...
...
@@ -92,8 +92,8 @@ void test_structinit_structinit__compare(void)
/* revert */
CHECK_MACRO_FUNC_INIT_EQUAL
(
\
git_revert_opt
s
,
GIT_REVERT_OPT
S_VERSION
,
\
GIT_REVERT_OPTS_INIT
,
git_revert_init_opts
);
git_revert_opt
ions
,
GIT_REVERT_OPTION
S_VERSION
,
\
GIT_REVERT_OPT
ION
S_INIT
,
git_revert_init_opts
);
/* status */
CHECK_MACRO_FUNC_INIT_EQUAL
(
\
...
...
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