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
1ab0523d
Unverified
Commit
1ab0523d
authored
Jun 14, 2019
by
Edward Thomson
Committed by
GitHub
Jun 14, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5101 from libgit2/ethomson/opts_init
Rename options initialization functions
parents
bed33a6f
c0dd7122
Hide whitespace changes
Inline
Side-by-side
Showing
47 changed files
with
297 additions
and
100 deletions
+297
-100
examples/describe.c
+3
-3
include/git2/apply.h
+3
-1
include/git2/blame.h
+2
-2
include/git2/checkout.h
+2
-2
include/git2/cherrypick.h
+1
-1
include/git2/clone.h
+2
-2
include/git2/deprecated.h
+55
-0
include/git2/describe.h
+4
-4
include/git2/diff.h
+6
-6
include/git2/indexer.h
+1
-1
include/git2/merge.h
+3
-7
include/git2/proxy.h
+1
-1
include/git2/rebase.h
+1
-1
include/git2/remote.h
+4
-4
include/git2/repository.h
+1
-1
include/git2/revert.h
+1
-1
include/git2/stash.h
+2
-2
include/git2/status.h
+1
-1
include/git2/submodule.h
+2
-2
include/git2/worktree.h
+5
-5
src/apply.c
+7
-0
src/blame.c
+6
-1
src/checkout.c
+6
-1
src/cherrypick.c
+7
-1
src/clone.c
+6
-1
src/describe.c
+13
-3
src/diff.c
+21
-4
src/diff_parse.c
+1
-1
src/fetch.c
+6
-1
src/indexer.c
+6
-1
src/merge.c
+19
-3
src/proxy.c
+7
-2
src/push.c
+6
-1
src/rebase.c
+7
-2
src/remote.c
+6
-1
src/repository.c
+7
-1
src/revert.c
+6
-1
src/stash.c
+6
-1
src/status.c
+7
-2
src/submodule.c
+6
-1
src/transports/http.c
+1
-1
src/worktree.c
+14
-2
tests/checkout/icase.c
+1
-1
tests/core/structinit.c
+21
-16
tests/diff/blob.c
+1
-1
tests/diff/patch.c
+1
-1
tests/diff/tree.c
+2
-2
No files found.
examples/describe.c
View file @
1ab0523d
...
...
@@ -63,7 +63,7 @@ static void do_describe_single(git_repository *repo, describe_options *opts, con
git_object
*
commit
;
git_describe_result
*
describe_result
;
git_buf
buf
=
{
0
};
if
(
rev
)
{
check_lg2
(
git_revparse_single
(
&
commit
,
repo
,
rev
),
"Failed to lookup rev"
,
rev
);
...
...
@@ -148,8 +148,8 @@ static void describe_options_init(describe_options *opts)
opts
->
commits
=
NULL
;
opts
->
commit_count
=
0
;
git_describe_
init_options
(
&
opts
->
describe_options
,
GIT_DESCRIBE_OPTIONS_VERSION
);
git_describe_
init_format_options
(
&
opts
->
format_options
,
GIT_DESCRIBE_FORMAT_OPTIONS_VERSION
);
git_describe_
options_init
(
&
opts
->
describe_options
,
GIT_DESCRIBE_OPTIONS_VERSION
);
git_describe_
format_options_init
(
&
opts
->
format_options
,
GIT_DESCRIBE_FORMAT_OPTIONS_VERSION
);
}
int
lg2_describe
(
git_repository
*
repo
,
int
argc
,
char
**
argv
)
...
...
include/git2/apply.h
View file @
1ab0523d
...
...
@@ -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.
...
...
include/git2/blame.h
View file @
1ab0523d
...
...
@@ -53,7 +53,7 @@ typedef enum {
* Blame options structure
*
* Initialize with `GIT_BLAME_OPTIONS_INIT`. Alternatively, you can
* use `git_blame_
init_options
`.
* use `git_blame_
options_init
`.
*
*/
typedef
struct
git_blame_options
{
...
...
@@ -100,7 +100,7 @@ typedef struct git_blame_options {
* @param version The struct version; pass `GIT_BLAME_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN
(
int
)
git_blame_
init_options
(
GIT_EXTERN
(
int
)
git_blame_
options_init
(
git_blame_options
*
opts
,
unsigned
int
version
);
...
...
include/git2/checkout.h
View file @
1ab0523d
...
...
@@ -256,7 +256,7 @@ typedef void GIT_CALLBACK(git_checkout_perfdata_cb)(
* Checkout options structure
*
* Initialize with `GIT_CHECKOUT_OPTIONS_INIT`. Alternatively, you can
* use `git_checkout_
init_options
`.
* use `git_checkout_
options_init
`.
*
*/
typedef
struct
git_checkout_options
{
...
...
@@ -318,7 +318,7 @@ typedef struct git_checkout_options {
* @param version The struct version; pass `GIT_CHECKOUT_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN
(
int
)
git_checkout_
init_options
(
GIT_EXTERN
(
int
)
git_checkout_
options_init
(
git_checkout_options
*
opts
,
unsigned
int
version
);
...
...
include/git2/cherrypick.h
View file @
1ab0523d
...
...
@@ -46,7 +46,7 @@ typedef struct {
* @param version The struct version; pass `GIT_CHERRYPICK_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN
(
int
)
git_cherrypick_
init_options
(
GIT_EXTERN
(
int
)
git_cherrypick_
options_init
(
git_cherrypick_options
*
opts
,
unsigned
int
version
);
...
...
include/git2/clone.h
View file @
1ab0523d
...
...
@@ -97,7 +97,7 @@ typedef int GIT_CALLBACK(git_repository_create_cb)(
* Clone options structure
*
* Initialize with `GIT_CLONE_OPTIONS_INIT`. Alternatively, you can
* use `git_clone_
init_options
`.
* use `git_clone_
options_init
`.
*
*/
typedef
struct
git_clone_options
{
...
...
@@ -178,7 +178,7 @@ typedef struct git_clone_options {
* @param version The struct version; pass `GIT_CLONE_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN
(
int
)
git_clone_
init_options
(
GIT_EXTERN
(
int
)
git_clone_
options_init
(
git_clone_options
*
opts
,
unsigned
int
version
);
...
...
include/git2/deprecated.h
View file @
1ab0523d
...
...
@@ -8,13 +8,29 @@
#define INCLUDE_git_deprecated_h__
#include "common.h"
#include "blame.h"
#include "buffer.h"
#include "checkout.h"
#include "cherrypick.h"
#include "clone.h"
#include "describe.h"
#include "diff.h"
#include "errors.h"
#include "index.h"
#include "indexer.h"
#include "merge.h"
#include "object.h"
#include "proxy.h"
#include "refs.h"
#include "rebase.h"
#include "remote.h"
#include "trace.h"
#include "repository.h"
#include "revert.h"
#include "stash.h"
#include "status.h"
#include "submodule.h"
#include "worktree.h"
/*
* Users can avoid deprecated functions by defining `GIT_DEPRECATE_HARD`.
...
...
@@ -316,6 +332,45 @@ typedef git_push_transfer_progress_cb git_push_transfer_progress;
/**@}*/
/** @name Deprecated Options Initialization Functions
*
* These functions are retained for backward compatibility. The newer
* versions of these functions should be preferred in all new code.
*
* There is no plan to remove these backward compatibility functions at
* this time.
*/
/**@{*/
GIT_EXTERN
(
int
)
git_blame_init_options
(
git_blame_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_checkout_init_options
(
git_checkout_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_cherrypick_init_options
(
git_cherrypick_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_clone_init_options
(
git_clone_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_describe_init_options
(
git_describe_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_describe_init_format_options
(
git_describe_format_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_diff_init_options
(
git_diff_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_diff_find_init_options
(
git_diff_find_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_diff_format_email_init_options
(
git_diff_format_email_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_diff_patchid_init_options
(
git_diff_patchid_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_fetch_init_options
(
git_fetch_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_indexer_init_options
(
git_indexer_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_merge_init_options
(
git_merge_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_merge_file_init_input
(
git_merge_file_input
*
input
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_merge_file_init_options
(
git_merge_file_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_proxy_init_options
(
git_proxy_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_push_init_options
(
git_push_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_rebase_init_options
(
git_rebase_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_remote_create_init_options
(
git_remote_create_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_repository_init_init_options
(
git_repository_init_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_revert_init_options
(
git_revert_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_stash_apply_init_options
(
git_stash_apply_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_status_init_options
(
git_status_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_submodule_update_init_options
(
git_submodule_update_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_worktree_add_init_options
(
git_worktree_add_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_worktree_prune_init_options
(
git_worktree_prune_options
*
opts
,
unsigned
int
version
);
/**@}*/
/** @} */
GIT_END_DECL
...
...
include/git2/describe.h
View file @
1ab0523d
...
...
@@ -37,7 +37,7 @@ typedef enum {
* Describe options structure
*
* Initialize with `GIT_DESCRIBE_OPTIONS_INIT`. Alternatively, you can
* use `git_describe_
init_options
`.
* use `git_describe_
options_init
`.
*
*/
typedef
struct
git_describe_options
{
...
...
@@ -79,13 +79,13 @@ typedef struct git_describe_options {
* @param version The struct version; pass `GIT_DESCRIBE_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN
(
int
)
git_describe_
init_options
(
git_describe_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_describe_
options_init
(
git_describe_options
*
opts
,
unsigned
int
version
);
/**
* Describe format options structure
*
* Initialize with `GIT_DESCRIBE_FORMAT_OPTIONS_INIT`. Alternatively, you can
* use `git_describe_format_
init_options
`.
* use `git_describe_format_
options_init
`.
*
*/
typedef
struct
{
...
...
@@ -126,7 +126,7 @@ typedef struct {
* @param version The struct version; pass `GIT_DESCRIBE_FORMAT_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN
(
int
)
git_describe_
init_format_options
(
git_describe_format_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_describe_
format_options_init
(
git_describe_format_options
*
opts
,
unsigned
int
version
);
/**
* A struct that stores the result of a describe operation.
...
...
include/git2/diff.h
View file @
1ab0523d
...
...
@@ -119,7 +119,7 @@ typedef enum {
/** Include unreadable files in the diff */
GIT_DIFF_INCLUDE_UNREADABLE
=
(
1u
<<
16
),
/** Include unreadable files in the diff */
GIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED
=
(
1u
<<
17
),
...
...
@@ -451,7 +451,7 @@ typedef struct {
* @param version The struct version; pass `GIT_DIFF_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN
(
int
)
git_diff_
init_options
(
GIT_EXTERN
(
int
)
git_diff_
options_init
(
git_diff_options
*
opts
,
unsigned
int
version
);
...
...
@@ -784,7 +784,7 @@ typedef struct {
* @param version The struct version; pass `GIT_DIFF_FIND_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN
(
int
)
git_diff_find_
init_options
(
GIT_EXTERN
(
int
)
git_diff_find_
options_init
(
git_diff_find_options
*
opts
,
unsigned
int
version
);
...
...
@@ -1448,7 +1448,7 @@ GIT_EXTERN(int) git_diff_commit_as_email(
* @param version The struct version; pass `GIT_DIFF_FORMAT_EMAIL_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN
(
int
)
git_diff_format_email_
init_options
(
GIT_EXTERN
(
int
)
git_diff_format_email_
options_init
(
git_diff_format_email_options
*
opts
,
unsigned
int
version
);
...
...
@@ -1456,7 +1456,7 @@ GIT_EXTERN(int) git_diff_format_email_init_options(
* Patch ID options structure
*
* Initialize with `GIT_PATCHID_OPTIONS_INIT`. Alternatively, you can
* use `git_
patchid_init_options
`.
* use `git_
diff_patchid_options_init
`.
*
*/
typedef
struct
git_diff_patchid_options
{
...
...
@@ -1476,7 +1476,7 @@ typedef struct git_diff_patchid_options {
* @param version The struct version; pass `GIT_DIFF_PATCHID_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN
(
int
)
git_diff_patchid_
init_options
(
GIT_EXTERN
(
int
)
git_diff_patchid_
options_init
(
git_diff_patchid_options
*
opts
,
unsigned
int
version
);
...
...
include/git2/indexer.h
View file @
1ab0523d
...
...
@@ -79,7 +79,7 @@ typedef struct git_indexer_options {
* @param version Version of struct; pass `GIT_INDEXER_OPTIONS_VERSION`
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN
(
int
)
git_indexer_
init_options
(
GIT_EXTERN
(
int
)
git_indexer_
options_init
(
git_indexer_options
*
opts
,
unsigned
int
version
);
...
...
include/git2/merge.h
View file @
1ab0523d
...
...
@@ -57,7 +57,7 @@ typedef struct {
* `GIT_MERGE_FILE_INPUT_VERSION` here.
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN
(
int
)
git_merge_file_in
it_inpu
t
(
GIT_EXTERN
(
int
)
git_merge_file_in
put_ini
t
(
git_merge_file_input
*
opts
,
unsigned
int
version
);
...
...
@@ -212,9 +212,7 @@ typedef struct {
* @param version The struct version; pass `GIT_MERGE_FILE_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN
(
int
)
git_merge_file_init_options
(
git_merge_file_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_merge_file_options_init
(
git_merge_file_options
*
opts
,
unsigned
int
version
);
/**
* Information about file-level merging
...
...
@@ -310,9 +308,7 @@ typedef struct {
* @param version The struct version; pass `GIT_MERGE_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN
(
int
)
git_merge_init_options
(
git_merge_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_merge_options_init
(
git_merge_options
*
opts
,
unsigned
int
version
);
/**
* The results of `git_merge_analysis` indicate the merge opportunities.
...
...
include/git2/proxy.h
View file @
1ab0523d
...
...
@@ -89,7 +89,7 @@ typedef struct {
* @param version The struct version; pass `GIT_PROXY_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN
(
int
)
git_proxy_
init_options
(
git_proxy_options
*
opts
,
unsigned
int
version
);
GIT_EXTERN
(
int
)
git_proxy_
options_init
(
git_proxy_options
*
opts
,
unsigned
int
version
);
GIT_END_DECL
...
...
include/git2/rebase.h
View file @
1ab0523d
...
...
@@ -156,7 +156,7 @@ typedef struct {
* @param version The struct version; pass `GIT_REBASE_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN
(
int
)
git_rebase_
init_options
(
GIT_EXTERN
(
int
)
git_rebase_
options_init
(
git_rebase_options
*
opts
,
unsigned
int
version
);
...
...
include/git2/remote.h
View file @
1ab0523d
...
...
@@ -56,7 +56,7 @@ typedef enum {
* Remote creation options structure
*
* Initialize with `GIT_REMOTE_CREATE_OPTIONS_INIT`. Alternatively, you can
* use `git_remote_create_
init_options
`.
* use `git_remote_create_
options_init
`.
*
*/
typedef
struct
git_remote_create_options
{
...
...
@@ -94,7 +94,7 @@ typedef struct git_remote_create_options {
* @param version The struct version; pass `GIT_REMOTE_CREATE_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN
(
int
)
git_remote_create_
init_options
(
GIT_EXTERN
(
int
)
git_remote_create_
options_init
(
git_remote_create_options
*
opts
,
unsigned
int
version
);
...
...
@@ -700,7 +700,7 @@ typedef struct {
* @param version The struct version; pass `GIT_FETCH_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN
(
int
)
git_fetch_
init_options
(
GIT_EXTERN
(
int
)
git_fetch_
options_init
(
git_fetch_options
*
opts
,
unsigned
int
version
);
...
...
@@ -750,7 +750,7 @@ typedef struct {
* @param version The struct version; pass `GIT_PUSH_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN
(
int
)
git_push_
init_options
(
GIT_EXTERN
(
int
)
git_push_
options_init
(
git_push_options
*
opts
,
unsigned
int
version
);
...
...
include/git2/repository.h
View file @
1ab0523d
...
...
@@ -323,7 +323,7 @@ typedef struct {
* @param version The struct version; pass `GIT_REPOSITORY_INIT_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN
(
int
)
git_repository_init_
init_options
(
GIT_EXTERN
(
int
)
git_repository_init_
options_init
(
git_repository_init_options
*
opts
,
unsigned
int
version
);
...
...
include/git2/revert.h
View file @
1ab0523d
...
...
@@ -46,7 +46,7 @@ typedef struct {
* @param version The struct version; pass `GIT_REVERT_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN
(
int
)
git_revert_
init_options
(
GIT_EXTERN
(
int
)
git_revert_
options_init
(
git_revert_options
*
opts
,
unsigned
int
version
);
...
...
include/git2/stash.h
View file @
1ab0523d
...
...
@@ -120,7 +120,7 @@ typedef int GIT_CALLBACK(git_stash_apply_progress_cb)(
* Stash application options structure
*
* Initialize with `GIT_STASH_APPLY_OPTIONS_INIT`. Alternatively, you can
* use `git_stash_apply_
init_options
`.
* use `git_stash_apply_
options_init
`.
*
*/
typedef
struct
git_stash_apply_options
{
...
...
@@ -153,7 +153,7 @@ typedef struct git_stash_apply_options {
* @param version The struct version; pass `GIT_STASH_APPLY_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN
(
int
)
git_stash_apply_
init_options
(
GIT_EXTERN
(
int
)
git_stash_apply_
options_init
(
git_stash_apply_options
*
opts
,
unsigned
int
version
);
/**
...
...
include/git2/status.h
View file @
1ab0523d
...
...
@@ -200,7 +200,7 @@ typedef struct {
* @param version The struct version; pass `GIT_STATUS_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN
(
int
)
git_status_
init_options
(
GIT_EXTERN
(
int
)
git_status_
options_init
(
git_status_options
*
opts
,
unsigned
int
version
);
...
...
include/git2/submodule.h
View file @
1ab0523d
...
...
@@ -122,7 +122,7 @@ typedef int GIT_CALLBACK(git_submodule_cb)(
* Submodule update options structure
*
* Initialize with `GIT_SUBMODULE_UPDATE_OPTIONS_INIT`. Alternatively, you can
* use `git_submodule_update_
init_options
`.
* use `git_submodule_update_
options_init
`.
*
*/
typedef
struct
git_submodule_update_options
{
...
...
@@ -168,7 +168,7 @@ typedef struct git_submodule_update_options {
* @param version The struct version; pass `GIT_SUBMODULE_UPDATE_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN
(
int
)
git_submodule_update_
init_options
(
GIT_EXTERN
(
int
)
git_submodule_update_
options_init
(
git_submodule_update_options
*
opts
,
unsigned
int
version
);
/**
...
...
include/git2/worktree.h
View file @
1ab0523d
...
...
@@ -78,7 +78,7 @@ GIT_EXTERN(int) git_worktree_validate(const git_worktree *wt);
* Worktree add options structure
*
* Initialize with `GIT_WORKTREE_ADD_OPTIONS_INIT`. Alternatively, you can
* use `git_worktree_add_
init_options
`.
* use `git_worktree_add_
options_init
`.
*
*/
typedef
struct
git_worktree_add_options
{
...
...
@@ -101,7 +101,7 @@ typedef struct git_worktree_add_options {
* @param version The struct version; pass `GIT_WORKTREE_ADD_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN
(
int
)
git_worktree_add_
init_options
(
git_worktree_add_options
*
opts
,
GIT_EXTERN
(
int
)
git_worktree_add_
options_init
(
git_worktree_add_options
*
opts
,
unsigned
int
version
);
/**
...
...
@@ -174,7 +174,7 @@ GIT_EXTERN(const char *) git_worktree_name(const git_worktree *wt);
* is valid for the lifetime of the git_worktree.
*/
GIT_EXTERN
(
const
char
*
)
git_worktree_path
(
const
git_worktree
*
wt
);
/**
* Flags which can be passed to git_worktree_prune to alter its
* behavior.
...
...
@@ -192,7 +192,7 @@ typedef enum {
* Worktree prune options structure
*
* Initialize with `GIT_WORKTREE_PRUNE_OPTIONS_INIT`. Alternatively, you can
* use `git_worktree_prune_
init_options
`.
* use `git_worktree_prune_
options_init
`.
*
*/
typedef
struct
git_worktree_prune_options
{
...
...
@@ -214,7 +214,7 @@ typedef struct git_worktree_prune_options {
* @param version The struct version; pass `GIT_WORKTREE_PRUNE_OPTIONS_VERSION`.
* @return Zero on success; -1 on failure.
*/
GIT_EXTERN
(
int
)
git_worktree_prune_
init_options
(
GIT_EXTERN
(
int
)
git_worktree_prune_
options_init
(
git_worktree_prune_options
*
opts
,
unsigned
int
version
);
...
...
src/apply.c
View file @
1ab0523d
...
...
@@ -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"):
*
...
...
src/blame.c
View file @
1ab0523d
...
...
@@ -524,9 +524,14 @@ int git_blame_buffer(
return
0
;
}
int
git_blame_
init_options
(
git_blame_options
*
opts
,
unsigned
int
version
)
int
git_blame_
options_init
(
git_blame_options
*
opts
,
unsigned
int
version
)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE
(
opts
,
version
,
git_blame_options
,
GIT_BLAME_OPTIONS_INIT
);
return
0
;
}
int
git_blame_init_options
(
git_blame_options
*
opts
,
unsigned
int
version
)
{
return
git_blame_options_init
(
opts
,
version
);
}
src/checkout.c
View file @
1ab0523d
...
...
@@ -2791,9 +2791,14 @@ int git_checkout_head(
return
git_checkout_tree
(
repo
,
NULL
,
opts
);
}
int
git_checkout_
init_options
(
git_checkout_options
*
opts
,
unsigned
int
version
)
int
git_checkout_
options_init
(
git_checkout_options
*
opts
,
unsigned
int
version
)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE
(
opts
,
version
,
git_checkout_options
,
GIT_CHECKOUT_OPTIONS_INIT
);
return
0
;
}
int
git_checkout_init_options
(
git_checkout_options
*
opts
,
unsigned
int
version
)
{
return
git_checkout_options_init
(
opts
,
version
);
}
src/cherrypick.c
View file @
1ab0523d
...
...
@@ -221,10 +221,16 @@ done:
return
error
;
}
int
git_cherrypick_
init_options
(
int
git_cherrypick_
options_init
(
git_cherrypick_options
*
opts
,
unsigned
int
version
)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE
(
opts
,
version
,
git_cherrypick_options
,
GIT_CHERRYPICK_OPTIONS_INIT
);
return
0
;
}
int
git_cherrypick_init_options
(
git_cherrypick_options
*
opts
,
unsigned
int
version
)
{
return
git_cherrypick_options_init
(
opts
,
version
);
}
src/clone.c
View file @
1ab0523d
...
...
@@ -455,13 +455,18 @@ int git_clone(
return
error
;
}
int
git_clone_
init_options
(
git_clone_options
*
opts
,
unsigned
int
version
)
int
git_clone_
options_init
(
git_clone_options
*
opts
,
unsigned
int
version
)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE
(
opts
,
version
,
git_clone_options
,
GIT_CLONE_OPTIONS_INIT
);
return
0
;
}
int
git_clone_init_options
(
git_clone_options
*
opts
,
unsigned
int
version
)
{
return
git_clone_options_init
(
opts
,
version
);
}
static
bool
can_link
(
const
char
*
src
,
const
char
*
dst
,
int
link
)
{
#ifdef GIT_WIN32
...
...
src/describe.c
View file @
1ab0523d
...
...
@@ -759,7 +759,7 @@ static int normalize_format_options(
const
git_describe_format_options
*
src
)
{
if
(
!
src
)
{
git_describe_
init_format_options
(
dst
,
GIT_DESCRIBE_FORMAT_OPTIONS_VERSION
);
git_describe_
format_options_init
(
dst
,
GIT_DESCRIBE_FORMAT_OPTIONS_VERSION
);
return
0
;
}
...
...
@@ -868,16 +868,26 @@ void git_describe_result_free(git_describe_result *result)
git__free
(
result
);
}
int
git_describe_
init_options
(
git_describe_options
*
opts
,
unsigned
int
version
)
int
git_describe_
options_init
(
git_describe_options
*
opts
,
unsigned
int
version
)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE
(
opts
,
version
,
git_describe_options
,
GIT_DESCRIBE_OPTIONS_INIT
);
return
0
;
}
int
git_describe_init_format_options
(
git_describe_format_options
*
opts
,
unsigned
int
version
)
int
git_describe_init_options
(
git_describe_options
*
opts
,
unsigned
int
version
)
{
return
git_describe_options_init
(
opts
,
version
);
}
int
git_describe_format_options_init
(
git_describe_format_options
*
opts
,
unsigned
int
version
)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE
(
opts
,
version
,
git_describe_format_options
,
GIT_DESCRIBE_FORMAT_OPTIONS_INIT
);
return
0
;
}
int
git_describe_init_format_options
(
git_describe_format_options
*
opts
,
unsigned
int
version
)
{
return
git_describe_format_options_init
(
opts
,
version
);
}
src/diff.c
View file @
1ab0523d
...
...
@@ -350,14 +350,19 @@ int git_diff_commit_as_email(
return
error
;
}
int
git_diff_
init_options
(
git_diff_options
*
opts
,
unsigned
int
version
)
int
git_diff_
options_init
(
git_diff_options
*
opts
,
unsigned
int
version
)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE
(
opts
,
version
,
git_diff_options
,
GIT_DIFF_OPTIONS_INIT
);
return
0
;
}
int
git_diff_find_init_options
(
int
git_diff_init_options
(
git_diff_options
*
opts
,
unsigned
int
version
)
{
return
git_diff_options_init
(
opts
,
version
);
}
int
git_diff_find_options_init
(
git_diff_find_options
*
opts
,
unsigned
int
version
)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE
(
...
...
@@ -365,7 +370,13 @@ int git_diff_find_init_options(
return
0
;
}
int
git_diff_format_email_init_options
(
int
git_diff_find_init_options
(
git_diff_find_options
*
opts
,
unsigned
int
version
)
{
return
git_diff_find_options_init
(
opts
,
version
);
}
int
git_diff_format_email_options_init
(
git_diff_format_email_options
*
opts
,
unsigned
int
version
)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE
(
...
...
@@ -374,6 +385,12 @@ int git_diff_format_email_init_options(
return
0
;
}
int
git_diff_format_email_init_options
(
git_diff_format_email_options
*
opts
,
unsigned
int
version
)
{
return
git_diff_format_email_options_init
(
opts
,
version
);
}
static
int
flush_hunk
(
git_oid
*
result
,
git_hash_ctx
*
ctx
)
{
git_oid
hash
;
...
...
@@ -481,7 +498,7 @@ out:
return
error
;
}
int
git_diff_patchid_
init_options
(
git_diff_patchid_options
*
opts
,
unsigned
int
version
)
int
git_diff_patchid_
options_init
(
git_diff_patchid_options
*
opts
,
unsigned
int
version
)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE
(
opts
,
version
,
git_diff_patchid_options
,
GIT_DIFF_PATCHID_OPTIONS_INIT
);
...
...
src/diff_parse.c
View file @
1ab0523d
...
...
@@ -45,7 +45,7 @@ static git_diff_parsed *diff_parsed_alloc(void)
diff
->
base
.
patch_fn
=
git_patch_parsed_from_diff
;
diff
->
base
.
free_fn
=
diff_parsed_free
;
if
(
git_diff_
init_options
(
&
diff
->
base
.
opts
,
GIT_DIFF_OPTIONS_VERSION
)
<
0
)
{
if
(
git_diff_
options_init
(
&
diff
->
base
.
opts
,
GIT_DIFF_OPTIONS_VERSION
)
<
0
)
{
git__free
(
diff
);
return
NULL
;
}
...
...
src/fetch.c
View file @
1ab0523d
...
...
@@ -148,9 +148,14 @@ int git_fetch_download_pack(git_remote *remote, const git_remote_callbacks *call
return
t
->
download_pack
(
t
,
remote
->
repo
,
&
remote
->
stats
,
progress
,
payload
);
}
int
git_fetch_
init_options
(
git_fetch_options
*
opts
,
unsigned
int
version
)
int
git_fetch_
options_init
(
git_fetch_options
*
opts
,
unsigned
int
version
)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE
(
opts
,
version
,
git_fetch_options
,
GIT_FETCH_OPTIONS_INIT
);
return
0
;
}
int
git_fetch_init_options
(
git_fetch_options
*
opts
,
unsigned
int
version
)
{
return
git_fetch_options_init
(
opts
,
version
);
}
src/indexer.c
View file @
1ab0523d
...
...
@@ -116,13 +116,18 @@ static int objects_cmp(const void *a, const void *b)
return
git_oid__cmp
(
&
entrya
->
oid
,
&
entryb
->
oid
);
}
int
git_indexer_
init_options
(
git_indexer_options
*
opts
,
unsigned
int
version
)
int
git_indexer_
options_init
(
git_indexer_options
*
opts
,
unsigned
int
version
)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE
(
opts
,
version
,
git_indexer_options
,
GIT_INDEXER_OPTIONS_INIT
);
return
0
;
}
int
git_indexer_init_options
(
git_indexer_options
*
opts
,
unsigned
int
version
)
{
return
git_indexer_options_init
(
opts
,
version
);
}
int
git_indexer_new
(
git_indexer
**
out
,
const
char
*
prefix
,
...
...
src/merge.c
View file @
1ab0523d
...
...
@@ -3322,24 +3322,40 @@ done:
return
error
;
}
int
git_merge_
init_options
(
git_merge_options
*
opts
,
unsigned
int
version
)
int
git_merge_
options_init
(
git_merge_options
*
opts
,
unsigned
int
version
)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE
(
opts
,
version
,
git_merge_options
,
GIT_MERGE_OPTIONS_INIT
);
return
0
;
}
int
git_merge_file_init_input
(
git_merge_file_input
*
input
,
unsigned
int
version
)
int
git_merge_init_options
(
git_merge_options
*
opts
,
unsigned
int
version
)
{
return
git_merge_options_init
(
opts
,
version
);
}
int
git_merge_file_input_init
(
git_merge_file_input
*
input
,
unsigned
int
version
)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE
(
input
,
version
,
git_merge_file_input
,
GIT_MERGE_FILE_INPUT_INIT
);
return
0
;
}
int
git_merge_file_init_options
(
int
git_merge_file_init_input
(
git_merge_file_input
*
input
,
unsigned
int
version
)
{
return
git_merge_file_input_init
(
input
,
version
);
}
int
git_merge_file_options_init
(
git_merge_file_options
*
opts
,
unsigned
int
version
)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE
(
opts
,
version
,
git_merge_file_options
,
GIT_MERGE_FILE_OPTIONS_INIT
);
return
0
;
}
int
git_merge_file_init_options
(
git_merge_file_options
*
opts
,
unsigned
int
version
)
{
return
git_merge_file_options_init
(
opts
,
version
);
}
src/proxy.c
View file @
1ab0523d
...
...
@@ -9,17 +9,22 @@
#include "git2/proxy.h"
int
git_proxy_
init_options
(
git_proxy_options
*
opts
,
unsigned
int
version
)
int
git_proxy_
options_init
(
git_proxy_options
*
opts
,
unsigned
int
version
)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE
(
opts
,
version
,
git_proxy_options
,
GIT_PROXY_OPTIONS_INIT
);
return
0
;
}
int
git_proxy_init_options
(
git_proxy_options
*
opts
,
unsigned
int
version
)
{
return
git_proxy_options_init
(
opts
,
version
);
}
int
git_proxy_options_dup
(
git_proxy_options
*
tgt
,
const
git_proxy_options
*
src
)
{
if
(
!
src
)
{
git_proxy_
init_options
(
tgt
,
GIT_PROXY_OPTIONS_VERSION
);
git_proxy_
options_init
(
tgt
,
GIT_PROXY_OPTIONS_VERSION
);
return
0
;
}
...
...
src/push.c
View file @
1ab0523d
...
...
@@ -547,9 +547,14 @@ void git_push_free(git_push *push)
git__free
(
push
);
}
int
git_push_
init_options
(
git_push_options
*
opts
,
unsigned
int
version
)
int
git_push_
options_init
(
git_push_options
*
opts
,
unsigned
int
version
)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE
(
opts
,
version
,
git_push_options
,
GIT_PUSH_OPTIONS_INIT
);
return
0
;
}
int
git_push_init_options
(
git_push_options
*
opts
,
unsigned
int
version
)
{
return
git_push_options_init
(
opts
,
version
);
}
src/rebase.c
View file @
1ab0523d
...
...
@@ -268,7 +268,7 @@ static int rebase_alloc(git_rebase **out, const git_rebase_options *rebase_opts)
if
(
rebase_opts
)
memcpy
(
&
rebase
->
options
,
rebase_opts
,
sizeof
(
git_rebase_options
));
else
git_rebase_
init_options
(
&
rebase
->
options
,
GIT_REBASE_OPTIONS_VERSION
);
git_rebase_
options_init
(
&
rebase
->
options
,
GIT_REBASE_OPTIONS_VERSION
);
if
(
rebase_opts
&&
rebase_opts
->
rewrite_notes_ref
)
{
rebase
->
options
.
rewrite_notes_ref
=
git__strdup
(
rebase_opts
->
rewrite_notes_ref
);
...
...
@@ -493,13 +493,18 @@ static int rebase_setupfiles(git_rebase *rebase)
return
rebase_setupfiles_merge
(
rebase
);
}
int
git_rebase_
init_options
(
git_rebase_options
*
opts
,
unsigned
int
version
)
int
git_rebase_
options_init
(
git_rebase_options
*
opts
,
unsigned
int
version
)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE
(
opts
,
version
,
git_rebase_options
,
GIT_REBASE_OPTIONS_INIT
);
return
0
;
}
int
git_rebase_init_options
(
git_rebase_options
*
opts
,
unsigned
int
version
)
{
return
git_rebase_options_init
(
opts
,
version
);
}
static
int
rebase_ensure_not_in_progress
(
git_repository
*
repo
)
{
int
error
;
...
...
src/remote.c
View file @
1ab0523d
...
...
@@ -217,13 +217,18 @@ static int ensure_remote_doesnot_exist(git_repository *repo, const char *name)
return
GIT_EEXISTS
;
}
int
git_remote_create_
init_options
(
git_remote_create_options
*
opts
,
unsigned
int
version
)
int
git_remote_create_
options_init
(
git_remote_create_options
*
opts
,
unsigned
int
version
)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE
(
opts
,
version
,
git_remote_create_options
,
GIT_REMOTE_CREATE_OPTIONS_INIT
);
return
0
;
}
int
git_remote_create_init_options
(
git_remote_create_options
*
opts
,
unsigned
int
version
)
{
return
git_remote_create_options_init
(
opts
,
version
);
}
int
git_remote_create_with_opts
(
git_remote
**
out
,
const
char
*
url
,
const
git_remote_create_options
*
opts
)
{
git_remote
*
remote
=
NULL
;
...
...
src/repository.c
View file @
1ab0523d
...
...
@@ -2870,7 +2870,7 @@ int git_repository_is_shallow(git_repository *repo)
return
st
.
st_size
==
0
?
0
:
1
;
}
int
git_repository_init_
init_options
(
int
git_repository_init_
options_init
(
git_repository_init_options
*
opts
,
unsigned
int
version
)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE
(
...
...
@@ -2879,6 +2879,12 @@ int git_repository_init_init_options(
return
0
;
}
int
git_repository_init_init_options
(
git_repository_init_options
*
opts
,
unsigned
int
version
)
{
return
git_repository_init_options_init
(
opts
,
version
);
}
int
git_repository_ident
(
const
char
**
name
,
const
char
**
email
,
const
git_repository
*
repo
)
{
*
name
=
repo
->
ident_name
;
...
...
src/revert.c
View file @
1ab0523d
...
...
@@ -224,9 +224,14 @@ done:
return
error
;
}
int
git_revert_
init_options
(
git_revert_options
*
opts
,
unsigned
int
version
)
int
git_revert_
options_init
(
git_revert_options
*
opts
,
unsigned
int
version
)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE
(
opts
,
version
,
git_revert_options
,
GIT_REVERT_OPTIONS_INIT
);
return
0
;
}
int
git_revert_init_options
(
git_revert_options
*
opts
,
unsigned
int
version
)
{
return
git_revert_options_init
(
opts
,
version
);
}
src/stash.c
View file @
1ab0523d
...
...
@@ -794,13 +794,18 @@ static void normalize_apply_options(
opts
->
checkout_options
.
their_label
=
"Stashed changes"
;
}
int
git_stash_apply_
init_options
(
git_stash_apply_options
*
opts
,
unsigned
int
version
)
int
git_stash_apply_
options_init
(
git_stash_apply_options
*
opts
,
unsigned
int
version
)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE
(
opts
,
version
,
git_stash_apply_options
,
GIT_STASH_APPLY_OPTIONS_INIT
);
return
0
;
}
int
git_stash_apply_init_options
(
git_stash_apply_options
*
opts
,
unsigned
int
version
)
{
return
git_stash_apply_options_init
(
opts
,
version
);
}
#define NOTIFY_PROGRESS(opts, progress_type) \
do { \
if ((opts).progress_cb && \
...
...
src/status.c
View file @
1ab0523d
...
...
@@ -280,7 +280,7 @@ int git_status_list_new(
if
((
error
=
git_repository__ensure_not_bare
(
repo
,
"status"
))
<
0
||
(
error
=
git_repository_index
(
&
index
,
repo
))
<
0
)
return
error
;
if
(
opts
!=
NULL
&&
opts
->
baseline
!=
NULL
)
{
head
=
opts
->
baseline
;
}
else
{
...
...
@@ -540,13 +540,18 @@ int git_status_should_ignore(
return
git_ignore_path_is_ignored
(
ignored
,
repo
,
path
);
}
int
git_status_
init_options
(
git_status_options
*
opts
,
unsigned
int
version
)
int
git_status_
options_init
(
git_status_options
*
opts
,
unsigned
int
version
)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE
(
opts
,
version
,
git_status_options
,
GIT_STATUS_OPTIONS_INIT
);
return
0
;
}
int
git_status_init_options
(
git_status_options
*
opts
,
unsigned
int
version
)
{
return
git_status_options_init
(
opts
,
version
);
}
int
git_status_list_get_perfdata
(
git_diff_perfdata
*
out
,
const
git_status_list
*
status
)
{
...
...
src/submodule.c
View file @
1ab0523d
...
...
@@ -1174,13 +1174,18 @@ static int git_submodule_update_repo_init_cb(
return
submodule_repo_create
(
out
,
sm
->
repo
,
path
);
}
int
git_submodule_update_
init_options
(
git_submodule_update_options
*
opts
,
unsigned
int
version
)
int
git_submodule_update_
options_init
(
git_submodule_update_options
*
opts
,
unsigned
int
version
)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE
(
opts
,
version
,
git_submodule_update_options
,
GIT_SUBMODULE_UPDATE_OPTIONS_INIT
);
return
0
;
}
int
git_submodule_update_init_options
(
git_submodule_update_options
*
opts
,
unsigned
int
version
)
{
return
git_submodule_update_options_init
(
opts
,
version
);
}
int
git_submodule_update
(
git_submodule
*
sm
,
int
init
,
git_submodule_update_options
*
_update_options
)
{
int
error
;
...
...
src/transports/http.c
View file @
1ab0523d
...
...
@@ -757,7 +757,7 @@ static int load_proxy_config(http_subtransport *t)
git__free
(
t
->
proxy_url
);
t
->
proxy_url
=
NULL
;
git_proxy_
init_options
(
&
t
->
proxy_opts
,
GIT_PROXY_OPTIONS_VERSION
);
git_proxy_
options_init
(
&
t
->
proxy_opts
,
GIT_PROXY_OPTIONS_VERSION
);
if
((
error
=
git_remote__get_http_proxy
(
t
->
owner
->
owner
,
!
strcmp
(
t
->
server
.
url
.
scheme
,
"https"
),
&
t
->
proxy_url
))
<
0
)
...
...
src/worktree.c
View file @
1ab0523d
...
...
@@ -260,7 +260,7 @@ int git_worktree_validate(const git_worktree *wt)
return
0
;
}
int
git_worktree_add_
init_options
(
git_worktree_add_options
*
opts
,
int
git_worktree_add_
options_init
(
git_worktree_add_options
*
opts
,
unsigned
int
version
)
{
GIT_INIT_STRUCTURE_FROM_TEMPLATE
(
opts
,
version
,
...
...
@@ -268,6 +268,12 @@ int git_worktree_add_init_options(git_worktree_add_options *opts,
return
0
;
}
int
git_worktree_add_init_options
(
git_worktree_add_options
*
opts
,
unsigned
int
version
)
{
return
git_worktree_add_options_init
(
opts
,
version
);
}
int
git_worktree_add
(
git_worktree
**
out
,
git_repository
*
repo
,
const
char
*
name
,
const
char
*
worktree
,
const
git_worktree_add_options
*
opts
)
...
...
@@ -478,7 +484,7 @@ const char *git_worktree_path(const git_worktree *wt)
return
wt
->
worktree_path
;
}
int
git_worktree_prune_
init_options
(
int
git_worktree_prune_
options_init
(
git_worktree_prune_options
*
opts
,
unsigned
int
version
)
{
...
...
@@ -487,6 +493,12 @@ int git_worktree_prune_init_options(
return
0
;
}
int
git_worktree_pruneinit_options
(
git_worktree_prune_options
*
opts
,
unsigned
int
version
)
{
return
git_worktree_prune_options_init
(
opts
,
version
);
}
int
git_worktree_is_prunable
(
git_worktree
*
wt
,
git_worktree_prune_options
*
opts
)
{
...
...
tests/checkout/icase.c
View file @
1ab0523d
...
...
@@ -33,7 +33,7 @@ void test_checkout_icase__initialize(void)
cl_git_pass
(
git_reference_name_to_id
(
&
id
,
repo
,
"refs/heads/dir"
));
cl_git_pass
(
git_object_lookup
(
&
obj
,
repo
,
&
id
,
GIT_OBJECT_ANY
));
git_checkout_
init_options
(
&
checkout_opts
,
GIT_CHECKOUT_OPTIONS_VERSION
);
git_checkout_
options_init
(
&
checkout_opts
,
GIT_CHECKOUT_OPTIONS_VERSION
);
checkout_opts
.
checkout_strategy
=
GIT_CHECKOUT_NONE
;
}
...
...
tests/core/structinit.c
View file @
1ab0523d
...
...
@@ -72,30 +72,35 @@ 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
,
\
GIT_BLAME_OPTIONS_INIT
,
git_blame_
init_options
);
GIT_BLAME_OPTIONS_INIT
,
git_blame_
options_init
);
/* checkout */
CHECK_MACRO_FUNC_INIT_EQUAL
(
\
git_checkout_options
,
GIT_CHECKOUT_OPTIONS_VERSION
,
\
GIT_CHECKOUT_OPTIONS_INIT
,
git_checkout_
init_options
);
GIT_CHECKOUT_OPTIONS_INIT
,
git_checkout_
options_init
);
/* clone */
CHECK_MACRO_FUNC_INIT_EQUAL
(
\
git_clone_options
,
GIT_CLONE_OPTIONS_VERSION
,
\
GIT_CLONE_OPTIONS_INIT
,
git_clone_
init_options
);
GIT_CLONE_OPTIONS_INIT
,
git_clone_
options_init
);
/* diff */
CHECK_MACRO_FUNC_INIT_EQUAL
(
\
git_diff_options
,
GIT_DIFF_OPTIONS_VERSION
,
\
GIT_DIFF_OPTIONS_INIT
,
git_diff_
init_options
);
GIT_DIFF_OPTIONS_INIT
,
git_diff_
options_init
);
/* diff_find */
CHECK_MACRO_FUNC_INIT_EQUAL
(
\
git_diff_find_options
,
GIT_DIFF_FIND_OPTIONS_VERSION
,
\
GIT_DIFF_FIND_OPTIONS_INIT
,
git_diff_find_
init_options
);
GIT_DIFF_FIND_OPTIONS_INIT
,
git_diff_find_
options_init
);
/* filter */
CHECK_MACRO_FUNC_INIT_EQUAL
(
\
...
...
@@ -105,22 +110,22 @@ void test_core_structinit__compare(void)
/* merge_file_input */
CHECK_MACRO_FUNC_INIT_EQUAL
(
\
git_merge_file_input
,
GIT_MERGE_FILE_INPUT_VERSION
,
\
GIT_MERGE_FILE_INPUT_INIT
,
git_merge_file_in
it_inpu
t
);
GIT_MERGE_FILE_INPUT_INIT
,
git_merge_file_in
put_ini
t
);
/* merge_file */
CHECK_MACRO_FUNC_INIT_EQUAL
(
\
git_merge_file_options
,
GIT_MERGE_FILE_OPTIONS_VERSION
,
\
GIT_MERGE_FILE_OPTIONS_INIT
,
git_merge_file_
init_options
);
GIT_MERGE_FILE_OPTIONS_INIT
,
git_merge_file_
options_init
);
/* merge_tree */
CHECK_MACRO_FUNC_INIT_EQUAL
(
\
git_merge_options
,
GIT_MERGE_OPTIONS_VERSION
,
\
GIT_MERGE_OPTIONS_INIT
,
git_merge_
init_options
);
GIT_MERGE_OPTIONS_INIT
,
git_merge_
options_init
);
/* push */
CHECK_MACRO_FUNC_INIT_EQUAL
(
\
git_push_options
,
GIT_PUSH_OPTIONS_VERSION
,
\
GIT_PUSH_OPTIONS_INIT
,
git_push_
init_options
);
GIT_PUSH_OPTIONS_INIT
,
git_push_
options_init
);
/* remote */
CHECK_MACRO_FUNC_INIT_EQUAL
(
\
...
...
@@ -130,22 +135,22 @@ void test_core_structinit__compare(void)
/* repository_init */
CHECK_MACRO_FUNC_INIT_EQUAL
(
\
git_repository_init_options
,
GIT_REPOSITORY_INIT_OPTIONS_VERSION
,
\
GIT_REPOSITORY_INIT_OPTIONS_INIT
,
git_repository_init_
init_options
);
GIT_REPOSITORY_INIT_OPTIONS_INIT
,
git_repository_init_
options_init
);
/* revert */
CHECK_MACRO_FUNC_INIT_EQUAL
(
\
git_revert_options
,
GIT_REVERT_OPTIONS_VERSION
,
\
GIT_REVERT_OPTIONS_INIT
,
git_revert_
init_options
);
GIT_REVERT_OPTIONS_INIT
,
git_revert_
options_init
);
/* stash apply */
CHECK_MACRO_FUNC_INIT_EQUAL
(
\
git_stash_apply_options
,
GIT_STASH_APPLY_OPTIONS_VERSION
,
\
GIT_STASH_APPLY_OPTIONS_INIT
,
git_stash_apply_
init_options
);
GIT_STASH_APPLY_OPTIONS_INIT
,
git_stash_apply_
options_init
);
/* status */
CHECK_MACRO_FUNC_INIT_EQUAL
(
\
git_status_options
,
GIT_STATUS_OPTIONS_VERSION
,
\
GIT_STATUS_OPTIONS_INIT
,
git_status_
init_options
);
GIT_STATUS_OPTIONS_INIT
,
git_status_
options_init
);
/* transport */
CHECK_MACRO_FUNC_INIT_EQUAL
(
\
...
...
@@ -170,14 +175,14 @@ void test_core_structinit__compare(void)
/* submodule update */
CHECK_MACRO_FUNC_INIT_EQUAL
(
\
git_submodule_update_options
,
GIT_SUBMODULE_UPDATE_OPTIONS_VERSION
,
\
GIT_SUBMODULE_UPDATE_OPTIONS_INIT
,
git_submodule_update_
init_options
);
GIT_SUBMODULE_UPDATE_OPTIONS_INIT
,
git_submodule_update_
options_init
);
/* submodule update */
CHECK_MACRO_FUNC_INIT_EQUAL
(
\
git_proxy_options
,
GIT_PROXY_OPTIONS_VERSION
,
\
GIT_PROXY_OPTIONS_INIT
,
git_proxy_
init_options
);
GIT_PROXY_OPTIONS_INIT
,
git_proxy_
options_init
);
CHECK_MACRO_FUNC_INIT_EQUAL
(
\
git_diff_patchid_options
,
GIT_DIFF_PATCHID_OPTIONS_VERSION
,
\
GIT_DIFF_PATCHID_OPTIONS_INIT
,
git_diff_patchid_
init_options
);
GIT_DIFF_PATCHID_OPTIONS_INIT
,
git_diff_patchid_
options_init
);
}
tests/diff/blob.c
View file @
1ab0523d
...
...
@@ -39,7 +39,7 @@ void test_diff_blob__initialize(void)
g_repo
=
cl_git_sandbox_init
(
"attr"
);
cl_git_pass
(
git_diff_
init_options
(
&
opts
,
GIT_DIFF_OPTIONS_VERSION
));
cl_git_pass
(
git_diff_
options_init
(
&
opts
,
GIT_DIFF_OPTIONS_VERSION
));
opts
.
context_lines
=
1
;
memset
(
&
expected
,
0
,
sizeof
(
expected
));
...
...
tests/diff/patch.c
View file @
1ab0523d
...
...
@@ -692,7 +692,7 @@ void test_diff_patch__can_strip_bad_utf8(void)
git_patch
*
patch
;
git_buf
buf
=
GIT_BUF_INIT
;
cl_git_pass
(
git_diff_
init_options
(
&
opts
,
GIT_DIFF_OPTIONS_VERSION
));
cl_git_pass
(
git_diff_
options_init
(
&
opts
,
GIT_DIFF_OPTIONS_VERSION
));
cl_git_pass
(
git_patch_from_buffers
(
&
patch
,
a
,
strlen
(
a
),
NULL
,
b
,
strlen
(
b
),
NULL
,
&
opts
));
cl_git_pass
(
git_patch_to_buf
(
&
buf
,
patch
));
...
...
tests/diff/tree.c
View file @
1ab0523d
...
...
@@ -9,7 +9,7 @@ static diff_expects expect;
void
test_diff_tree__initialize
(
void
)
{
cl_git_pass
(
git_diff_
init_options
(
&
opts
,
GIT_DIFF_OPTIONS_VERSION
));
cl_git_pass
(
git_diff_
options_init
(
&
opts
,
GIT_DIFF_OPTIONS_VERSION
));
memset
(
&
expect
,
0
,
sizeof
(
expect
));
...
...
@@ -472,7 +472,7 @@ void test_diff_tree__diff_configs(void)
cl_git_pass
(
git_diff_tree_to_tree
(
&
diff
,
g_repo
,
a
,
b
,
NULL
));
cl_git_pass
(
git_diff_foreach
(
diff
,
cl_git_pass
(
git_diff_foreach
(
diff
,
diff_file_cb
,
diff_binary_cb
,
diff_hunk_cb
,
diff_line_cb
,
&
expect
));
cl_assert_equal_i
(
2
,
expect
.
files
);
...
...
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