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
cf7850a4
Commit
cf7850a4
authored
Apr 03, 2013
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Duplicated type object
parent
8842c75f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
12 deletions
+8
-12
src/cache.h
+2
-2
src/object.c
+6
-9
src/object.h
+0
-1
No files found.
src/cache.h
View file @
cf7850a4
...
...
@@ -22,9 +22,9 @@ enum {
typedef
struct
{
git_oid
oid
;
int32_t
type
;
int16_t
type
;
uint16_t
flags
;
size_t
size
;
uint32_t
flags
;
git_atomic
refcount
;
}
git_cached_obj
;
...
...
src/object.c
View file @
cf7850a4
...
...
@@ -71,8 +71,6 @@ static int create_object(git_object **object_out, git_otype type)
return
-
1
;
}
object
->
type
=
type
;
*
object_out
=
object
;
return
0
;
}
...
...
@@ -92,17 +90,16 @@ int git_object__from_odb_object(
return
GIT_ENOTFOUND
;
}
type
=
odb_obj
->
cached
.
type
;
if
((
error
=
create_object
(
&
object
,
type
))
<
0
)
if
((
error
=
create_object
(
&
object
,
odb_obj
->
cached
.
type
))
<
0
)
return
error
;
/* Initialize parent object */
git_oid_cpy
(
&
object
->
cached
.
oid
,
&
odb_obj
->
cached
.
oid
);
object
->
cached
.
size
=
odb_obj
->
cached
.
size
;
object
->
cached
.
type
=
odb_obj
->
cached
.
type
;
object
->
repo
=
repo
;
switch
(
type
)
{
switch
(
object
->
cached
.
type
)
{
case
GIT_OBJ_COMMIT
:
error
=
git_commit__parse
((
git_commit
*
)
object
,
odb_obj
);
break
;
...
...
@@ -167,7 +164,7 @@ int git_object_lookup_prefix(
if
(
cached
->
flags
==
GIT_CACHE_STORE_PARSED
)
{
object
=
(
git_object
*
)
cached
;
if
(
type
!=
GIT_OBJ_ANY
&&
type
!=
object
->
type
)
{
if
(
type
!=
GIT_OBJ_ANY
&&
type
!=
object
->
cached
.
type
)
{
git_object_free
(
object
);
giterr_set
(
GITERR_INVALID
,
"The requested type does not match the type in ODB"
);
...
...
@@ -231,7 +228,7 @@ void git_object__free(void *_obj)
assert
(
object
);
switch
(
object
->
type
)
{
switch
(
object
->
cached
.
type
)
{
case
GIT_OBJ_COMMIT
:
git_commit__free
((
git_commit
*
)
object
);
break
;
...
...
@@ -271,7 +268,7 @@ const git_oid *git_object_id(const git_object *obj)
git_otype
git_object_type
(
const
git_object
*
obj
)
{
assert
(
obj
);
return
obj
->
type
;
return
obj
->
cached
.
type
;
}
git_repository
*
git_object_owner
(
const
git_object
*
obj
)
...
...
src/object.h
View file @
cf7850a4
...
...
@@ -11,7 +11,6 @@
struct
git_object
{
git_cached_obj
cached
;
git_repository
*
repo
;
git_otype
type
;
};
/* fully free the object; internal method, DO NOT EXPORT */
...
...
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