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
0c72248b
Commit
0c72248b
authored
Apr 29, 2013
by
Russell Belfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce git_oid_compare, an exported oid cmp
parent
0f85c208
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
include/git2/oid.h
+9
-0
src/oid.c
+5
-0
No files found.
include/git2/oid.h
View file @
0c72248b
...
...
@@ -145,6 +145,15 @@ GIT_EXTERN(void) git_oid_cpy(git_oid *out, const git_oid *src);
* @param b second oid structure.
* @return <0, 0, >0 if a < b, a == b, a > b.
*/
GIT_EXTERN
(
int
)
git_oid_compare
(
const
git_oid
*
oid_a
,
const
git_oid
*
oid_b
);
/**
* Compare two oid structures.
*
* @param a first oid structure.
* @param b second oid structure.
* @return <0, 0, >0 if a < b, a == b, a > b.
*/
GIT_INLINE
(
int
)
git_oid_cmp
(
const
git_oid
*
a
,
const
git_oid
*
b
)
{
const
unsigned
char
*
sha1
=
a
->
id
;
...
...
src/oid.c
View file @
0c72248b
...
...
@@ -166,6 +166,11 @@ void git_oid_cpy(git_oid *out, const git_oid *src)
memcpy
(
out
->
id
,
src
->
id
,
sizeof
(
out
->
id
));
}
int
git_oid_compare
(
const
git_oid
*
oid_a
,
const
git_oid
*
oid_b
)
{
return
git_oid_cmp
(
oid_a
,
oid_b
);
}
int
git_oid_ncmp
(
const
git_oid
*
oid_a
,
const
git_oid
*
oid_b
,
size_t
len
)
{
const
unsigned
char
*
a
=
oid_a
->
id
;
...
...
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