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
5bd139e9
Commit
5bd139e9
authored
Apr 05, 2020
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revparse: use GIT_ASSERT
parent
055fbf6d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
src/revparse.c
+11
-6
No files found.
src/revparse.c
View file @
5bd139e9
...
...
@@ -317,7 +317,7 @@ static int handle_at_syntax(git_object **out, git_reference **ref, const char *s
git_buf
identifier
=
GIT_BUF_INIT
;
git_time_t
timestamp
;
assert
(
*
out
==
NULL
);
GIT_ASSERT
(
*
out
==
NULL
);
if
(
git_buf_put
(
&
identifier
,
spec
,
identifier_len
)
<
0
)
return
-
1
;
...
...
@@ -524,7 +524,7 @@ static int extract_curly_braces_content(git_buf *buf, const char *spec, size_t *
{
git_buf_clear
(
buf
);
assert
(
spec
[
*
pos
]
==
'^'
||
spec
[
*
pos
]
==
'@'
);
GIT_ASSERT_ARG
(
spec
[
*
pos
]
==
'^'
||
spec
[
*
pos
]
==
'@'
);
(
*
pos
)
++
;
...
...
@@ -550,7 +550,7 @@ static int extract_path(git_buf *buf, const char *spec, size_t *pos)
{
git_buf_clear
(
buf
);
assert
(
spec
[
*
pos
]
==
':'
);
GIT_ASSERT_ARG
(
spec
[
*
pos
]
==
':'
);
(
*
pos
)
++
;
...
...
@@ -568,7 +568,7 @@ static int extract_how_many(int *n, const char *spec, size_t *pos)
int
parsed
,
accumulated
;
char
kind
=
spec
[
*
pos
];
assert
(
spec
[
*
pos
]
==
'^'
||
spec
[
*
pos
]
==
'~'
);
GIT_ASSERT_ARG
(
spec
[
*
pos
]
==
'^'
||
spec
[
*
pos
]
==
'~'
);
accumulated
=
0
;
...
...
@@ -676,7 +676,10 @@ static int revparse(
bool
should_return_reference
=
true
;
assert
(
object_out
&&
reference_out
&&
repo
&&
spec
);
GIT_ASSERT_ARG
(
object_out
);
GIT_ASSERT_ARG
(
reference_out
);
GIT_ASSERT_ARG
(
repo
);
GIT_ASSERT_ARG
(
spec
);
*
object_out
=
NULL
;
*
reference_out
=
NULL
;
...
...
@@ -882,7 +885,9 @@ int git_revparse(
const
char
*
dotdot
;
int
error
=
0
;
assert
(
revspec
&&
repo
&&
spec
);
GIT_ASSERT_ARG
(
revspec
);
GIT_ASSERT_ARG
(
repo
);
GIT_ASSERT_ARG
(
spec
);
memset
(
revspec
,
0x0
,
sizeof
(
*
revspec
));
...
...
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