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
e7604da8
Commit
e7604da8
authored
Apr 05, 2020
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
config: use GIT_ASSERT
parent
3b2153fe
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
10 deletions
+15
-10
src/config.c
+12
-7
src/config_file.c
+2
-2
src/config_parse.c
+1
-1
No files found.
src/config.c
View file @
e7604da8
...
...
@@ -108,7 +108,8 @@ int git_config_add_file_ondisk(
struct
stat
st
;
int
res
;
assert
(
cfg
&&
path
);
GIT_ASSERT_ARG
(
cfg
);
GIT_ASSERT_ARG
(
path
);
res
=
p_stat
(
path
,
&
st
);
if
(
res
<
0
&&
errno
!=
ENOENT
&&
errno
!=
ENOTDIR
)
{
...
...
@@ -316,7 +317,8 @@ int git_config_add_backend(
backend_internal
*
internal
;
int
result
;
assert
(
cfg
&&
backend
);
GIT_ASSERT_ARG
(
cfg
);
GIT_ASSERT_ARG
(
backend
);
GIT_ERROR_CHECK_VERSION
(
backend
,
GIT_CONFIG_BACKEND_VERSION
,
"git_config_backend"
);
...
...
@@ -514,7 +516,8 @@ int git_config_backend_foreach_match(
git_regexp
regex
;
int
error
=
0
;
assert
(
backend
&&
cb
);
GIT_ASSERT_ARG
(
backend
);
GIT_ASSERT_ARG
(
cb
);
if
(
regexp
&&
git_regexp_compile
(
&
regex
,
regexp
,
0
)
<
0
)
return
-
1
;
...
...
@@ -1197,7 +1200,7 @@ int git_config_lock(git_transaction **out, git_config *cfg)
git_config_backend
*
backend
;
backend_internal
*
internal
;
assert
(
cfg
);
GIT_ASSERT_ARG
(
cfg
);
internal
=
git_vector_get
(
&
cfg
->
backends
,
0
);
if
(
!
internal
||
!
internal
->
backend
)
{
...
...
@@ -1217,7 +1220,7 @@ int git_config_unlock(git_config *cfg, int commit)
git_config_backend
*
backend
;
backend_internal
*
internal
;
assert
(
cfg
);
GIT_ASSERT_ARG
(
cfg
);
internal
=
git_vector_get
(
&
cfg
->
backends
,
0
);
if
(
!
internal
||
!
internal
->
backend
)
{
...
...
@@ -1377,7 +1380,8 @@ int git_config_parse_path(git_buf *out, const char *value)
{
int
error
;
assert
(
out
&&
value
);
GIT_ASSERT_ARG
(
out
);
GIT_ASSERT_ARG
(
value
);
if
((
error
=
git_buf_sanitize
(
out
))
<
0
)
return
error
;
...
...
@@ -1423,7 +1427,8 @@ int git_config__normalize_name(const char *in, char **out)
{
char
*
name
,
*
fdot
,
*
ldot
;
assert
(
in
&&
out
);
GIT_ASSERT_ARG
(
in
);
GIT_ASSERT_ARG
(
out
);
name
=
git__strdup
(
in
);
GIT_ERROR_CHECK_ALLOC
(
name
);
...
...
src/config_file.c
View file @
e7604da8
...
...
@@ -365,7 +365,7 @@ static int config_file_set_multivar(
int
result
;
char
*
key
;
assert
(
regexp
);
GIT_ASSERT_ARG
(
regexp
);
if
((
result
=
git_config__normalize_name
(
name
,
&
key
))
<
0
)
return
result
;
...
...
@@ -531,7 +531,7 @@ static char *escape_value(const char *ptr)
size_t
len
;
const
char
*
esc
;
assert
(
ptr
);
GIT_ASSERT_ARG_WITH_RETVAL
(
ptr
,
NULL
);
len
=
strlen
(
ptr
);
if
(
!
len
)
...
...
src/config_parse.c
View file @
e7604da8
...
...
@@ -187,7 +187,7 @@ static int parse_section_header(git_config_parser *reader, char **section_out)
/* Make sure we were given a section header */
c
=
line
[
pos
++
];
assert
(
c
==
'['
);
GIT_ASSERT
(
c
==
'['
);
c
=
line
[
pos
++
];
...
...
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