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
26875825
Commit
26875825
authored
Mar 05, 2014
by
Russell Belfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check short OID len in odb, not in backends
parent
13f7ecd7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
10 deletions
+3
-10
src/odb.c
+0
-1
src/odb_loose.c
+3
-9
No files found.
src/odb.c
View file @
26875825
...
...
@@ -800,7 +800,6 @@ int git_odb_read_prefix(
if
(
len
<
GIT_OID_MINPREFIXLEN
)
return
git_odb__error_ambiguous
(
"prefix length too short"
);
if
(
len
>
GIT_OID_HEXSZ
)
len
=
GIT_OID_HEXSZ
;
...
...
src/odb_loose.c
View file @
26875825
...
...
@@ -647,12 +647,9 @@ static int loose_backend__read_prefix(
{
int
error
=
0
;
assert
(
len
<=
GIT_OID_HEXSZ
);
assert
(
len
>=
GIT_OID_MINPREFIXLEN
&&
len
<=
GIT_OID_HEXSZ
);
if
(
len
<
GIT_OID_MINPREFIXLEN
)
error
=
git_odb__error_ambiguous
(
"prefix length too short"
);
else
if
(
len
==
GIT_OID_HEXSZ
)
{
if
(
len
==
GIT_OID_HEXSZ
)
{
/* We can fall back to regular read method */
error
=
loose_backend__read
(
buffer_p
,
len_p
,
type_p
,
backend
,
short_oid
);
if
(
!
error
)
...
...
@@ -698,10 +695,7 @@ static int loose_backend__exists_prefix(
git_buf
object_path
=
GIT_BUF_INIT
;
int
error
;
assert
(
backend
&&
out
&&
short_id
);
if
(
len
<
GIT_OID_MINPREFIXLEN
)
return
git_odb__error_ambiguous
(
"prefix length too short"
);
assert
(
backend
&&
out
&&
short_id
&&
len
>=
GIT_OID_MINPREFIXLEN
);
error
=
locate_object_short_oid
(
&
object_path
,
out
,
(
loose_backend
*
)
backend
,
short_id
,
len
);
...
...
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