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
ac22d08f
Commit
ac22d08f
authored
Nov 29, 2012
by
Philip Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove git_object_oid2type
parent
613d5eb9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
37 deletions
+0
-37
include/git2/object.h
+0
-11
src/object.c
+0
-15
tests-clar/object/lookup.c
+0
-11
No files found.
include/git2/object.h
View file @
ac22d08f
...
...
@@ -95,17 +95,6 @@ GIT_EXTERN(const git_oid *) git_object_id(const git_object *obj);
GIT_EXTERN
(
git_otype
)
git_object_type
(
const
git_object
*
obj
);
/**
* Get the object type of an object id
*
* @param obj the repository object
* @return the object's type
*/
GIT_EXTERN
(
int
)
git_object_oid2type
(
git_otype
*
type
,
git_repository
*
repo
,
const
git_oid
*
oid
);
/**
* Get the repository that owns this object
*
* Freeing or calling `git_repository_close` on the
...
...
src/object.c
View file @
ac22d08f
...
...
@@ -374,18 +374,3 @@ int git_object_peel(
return
-
1
;
}
int
git_object_oid2type
(
git_otype
*
type
,
git_repository
*
repo
,
const
git_oid
*
oid
)
{
git_object
*
obj
;
if
(
git_object_lookup
(
&
obj
,
repo
,
oid
,
GIT_OBJ_ANY
)
<
0
)
return
-
1
;
*
type
=
git_object_type
(
obj
);
git_object_free
(
obj
);
return
0
;
}
tests-clar/object/lookup.c
View file @
ac22d08f
...
...
@@ -63,14 +63,3 @@ void test_object_lookup__lookup_wrong_type_eventually_returns_enotfound(void)
GIT_ENOTFOUND
,
git_object_lookup
(
&
object
,
g_repo
,
&
oid
,
GIT_OBJ_TAG
));
}
void
test_object_lookup__lookup_object_type_by_oid
(
void
)
{
const
char
*
commit
=
"e90810b8df3e80c413d903f631643c716887138d"
;
git_oid
oid
;
git_otype
type
;
cl_git_pass
(
git_oid_fromstr
(
&
oid
,
commit
));
cl_git_pass
(
git_object_oid2type
(
&
type
,
g_repo
,
&
oid
));
cl_assert
(
type
==
GIT_OBJ_COMMIT
);
}
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