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
0c8efb38
Commit
0c8efb38
authored
Mar 21, 2013
by
Xavier L
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added an oid function that accepts nul-terminated strings
parent
7dbf4039
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
include/git2/oid.h
+10
-0
src/oid.c
+5
-0
No files found.
include/git2/oid.h
View file @
0c8efb38
...
...
@@ -47,6 +47,16 @@ typedef struct git_oid {
GIT_EXTERN
(
int
)
git_oid_fromstr
(
git_oid
*
out
,
const
char
*
str
);
/**
* Parse a hex formatted null-terminated string into a git_oid.
*
* @param out oid structure the result is written into.
* @param str input hex string; must be at least 4 characters
* long and null-terminated.
* @return 0 or an error code
*/
GIT_EXTERN
(
int
)
git_oid_fromstrp
(
git_oid
*
out
,
const
char
*
str
);
/**
* Parse N characters of a hex formatted object id into a git_oid
*
* If N is odd, N-1 characters will be parsed instead.
...
...
src/oid.c
View file @
0c8efb38
...
...
@@ -51,6 +51,11 @@ int git_oid_fromstrn(git_oid *out, const char *str, size_t length)
return
0
;
}
int
git_oid_fromstrp
(
git_oid
*
out
,
const
char
*
str
)
{
return
git_oid_fromstrn
(
out
,
str
,
min
(
strlen
(
str
),
GIT_OID_HEXSZ
));
}
int
git_oid_fromstr
(
git_oid
*
out
,
const
char
*
str
)
{
return
git_oid_fromstrn
(
out
,
str
,
GIT_OID_HEXSZ
);
...
...
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