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
1bbcb2b2
Commit
1bbcb2b2
authored
Mar 09, 2016
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
odb: Try to lookup headers in all backends before passthrough
parent
e78d2ac9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
4 deletions
+19
-4
src/odb.c
+19
-4
No files found.
src/odb.c
View file @
1bbcb2b2
...
...
@@ -855,8 +855,9 @@ static int odb_read_header_1(
const
git_oid
*
id
,
bool
only_refreshed
)
{
size_t
i
;
int
error
=
GIT_PASSTHROUGH
;
git_otype
ht
;
bool
passthrough
=
false
;
int
error
;
if
(
!
only_refreshed
&&
(
ht
=
odb_hardcoded_type
(
id
))
!=
GIT_OBJ_BAD
)
{
*
type_p
=
ht
;
...
...
@@ -864,18 +865,32 @@ static int odb_read_header_1(
return
0
;
}
for
(
i
=
0
;
i
<
db
->
backends
.
length
&&
error
<
0
;
++
i
)
{
for
(
i
=
0
;
i
<
db
->
backends
.
length
;
++
i
)
{
backend_internal
*
internal
=
git_vector_get
(
&
db
->
backends
,
i
);
git_odb_backend
*
b
=
internal
->
backend
;
if
(
only_refreshed
&&
!
b
->
refresh
)
continue
;
if
(
b
->
read_header
!=
NULL
)
error
=
b
->
read_header
(
len_p
,
type_p
,
b
,
id
);
if
(
!
b
->
read_header
)
{
passthrough
=
true
;
continue
;
}
error
=
b
->
read_header
(
len_p
,
type_p
,
b
,
id
);
switch
(
error
)
{
case
GIT_PASSTHROUGH
:
passthrough
=
true
;
break
;
case
GIT_ENOTFOUND
:
break
;
default:
return
error
;
}
}
return
passthrough
?
GIT_PASSTHROUGH
:
GIT_ENOTFOUND
;
}
int
git_odb__read_header_or_object
(
...
...
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