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
b60deb02
Commit
b60deb02
authored
Feb 22, 2012
by
Jay Freeman (saurik)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Export parse_tag_buffer as git_tag__parse_buffer.
parent
9c94a356
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
src/tag.c
+5
-3
src/tag.h
+1
-0
No files found.
src/tag.c
View file @
b60deb02
...
...
@@ -61,7 +61,7 @@ const char *git_tag_message(git_tag *t)
return
t
->
message
;
}
static
int
parse_tag_buffer
(
git_tag
*
tag
,
const
char
*
buffer
,
const
char
*
buffer_end
)
int
git_tag__parse_buffer
(
git_tag
*
tag
,
const
char
*
buffer
,
size_t
length
)
{
static
const
char
*
tag_types
[]
=
{
NULL
,
"commit
\n
"
,
"tree
\n
"
,
"blob
\n
"
,
"tag
\n
"
...
...
@@ -71,6 +71,8 @@ static int parse_tag_buffer(git_tag *tag, const char *buffer, const char *buffer
char
*
search
;
int
error
;
const
char
*
buffer_end
=
buffer
+
length
;
if
((
error
=
git_oid__parse
(
&
tag
->
target
,
&
buffer
,
buffer_end
,
"object "
))
<
0
)
return
git__rethrow
(
error
,
"Failed to parse tag. Object field invalid"
);
...
...
@@ -316,7 +318,7 @@ int git_tag_create_frombuffer(git_oid *oid, git_repository *repo, const char *bu
return
error
;
/* validate the buffer */
if
((
error
=
parse_tag_buffer
(
&
tag
,
buffer
,
buffer
+
strlen
(
buffer
)))
<
GIT_SUCCESS
)
if
((
error
=
git_tag__parse_buffer
(
&
tag
,
buffer
,
strlen
(
buffer
)))
<
GIT_SUCCESS
)
goto
cleanup
;
/* validate the target */
...
...
@@ -397,7 +399,7 @@ int git_tag_delete(git_repository *repo, const char *tag_name)
int
git_tag__parse
(
git_tag
*
tag
,
git_odb_object
*
obj
)
{
assert
(
tag
);
return
parse_tag_buffer
(
tag
,
obj
->
raw
.
data
,
(
char
*
)
obj
->
raw
.
data
+
obj
->
raw
.
len
);
return
git_tag__parse_buffer
(
tag
,
obj
->
raw
.
data
,
obj
->
raw
.
len
);
}
typedef
struct
{
...
...
src/tag.h
View file @
b60deb02
...
...
@@ -24,5 +24,6 @@ struct git_tag {
void
git_tag__free
(
git_tag
*
tag
);
int
git_tag__parse
(
git_tag
*
tag
,
git_odb_object
*
obj
);
int
git_tag__parse_buffer
(
git_tag
*
tag
,
const
char
*
data
,
size_t
len
);
#endif
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