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
e4af0f00
Commit
e4af0f00
authored
Apr 29, 2013
by
Russell Belfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new src/oid.h
parent
d7761102
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
src/oid.h
+33
-0
No files found.
src/oid.h
0 → 100644
View file @
e4af0f00
/*
* Copyright (C) the libgit2 contributors. All rights reserved.
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#ifndef INCLUDE_oid_h__
#define INCLUDE_oid_h__
#include "git2/oid.h"
/*
* 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
;
const
unsigned
char
*
sha2
=
b
->
id
;
int
i
;
for
(
i
=
0
;
i
<
GIT_OID_RAWSZ
;
i
++
,
sha1
++
,
sha2
++
)
{
if
(
*
sha1
!=
*
sha2
)
return
*
sha1
-
*
sha2
;
}
return
0
;
}
#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