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
7107b599
Commit
7107b599
authored
Jun 02, 2011
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
odb-pack: More variable declarations
parent
7b5fe049
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
src/odb_pack.c
+5
-4
No files found.
src/odb_pack.c
View file @
7107b599
...
@@ -960,6 +960,7 @@ static int pack_entry_find_offset(
...
@@ -960,6 +960,7 @@ static int pack_entry_find_offset(
const
unsigned
char
*
index
=
p
->
index_map
.
data
;
const
unsigned
char
*
index
=
p
->
index_map
.
data
;
unsigned
hi
,
lo
,
stride
;
unsigned
hi
,
lo
,
stride
;
int
pos
,
found
=
0
;
int
pos
,
found
=
0
;
const
unsigned
char
*
current
;
*
offset_out
=
0
;
*
offset_out
=
0
;
...
@@ -999,7 +1000,6 @@ static int pack_entry_find_offset(
...
@@ -999,7 +1000,6 @@ static int pack_entry_find_offset(
/* Use git.git lookup code */
/* Use git.git lookup code */
pos
=
sha1_entry_pos
(
index
,
stride
,
0
,
lo
,
hi
,
p
->
num_objects
,
short_oid
->
id
);
pos
=
sha1_entry_pos
(
index
,
stride
,
0
,
lo
,
hi
,
p
->
num_objects
,
short_oid
->
id
);
const
unsigned
char
*
current
;
if
(
pos
>=
0
)
{
if
(
pos
>=
0
)
{
/* An object matching exactly the oid was found */
/* An object matching exactly the oid was found */
found
=
1
;
found
=
1
;
...
@@ -1051,6 +1051,8 @@ static int pack_entry_find1(
...
@@ -1051,6 +1051,8 @@ static int pack_entry_find1(
unsigned
int
len
)
unsigned
int
len
)
{
{
off_t
offset
;
off_t
offset
;
git_oid
found_oid
;
int
error
;
assert
(
p
);
assert
(
p
);
...
@@ -1061,8 +1063,7 @@ static int pack_entry_find1(
...
@@ -1061,8 +1063,7 @@ static int pack_entry_find1(
return
git__throw
(
GIT_ERROR
,
"Failed to find pack entry. Bad object found"
);
return
git__throw
(
GIT_ERROR
,
"Failed to find pack entry. Bad object found"
);
}
}
git_oid
found_oid
;
error
=
pack_entry_find_offset
(
&
offset
,
&
found_oid
,
p
,
short_oid
,
len
);
int
error
=
pack_entry_find_offset
(
&
offset
,
&
found_oid
,
p
,
short_oid
,
len
);
if
(
error
<
GIT_SUCCESS
)
if
(
error
<
GIT_SUCCESS
)
return
git__rethrow
(
error
,
"Failed to find pack entry. Couldn't find offset"
);
return
git__rethrow
(
error
,
"Failed to find pack entry. Couldn't find offset"
);
...
@@ -1115,11 +1116,11 @@ static int pack_entry_find_prefix(
...
@@ -1115,11 +1116,11 @@ static int pack_entry_find_prefix(
{
{
int
error
;
int
error
;
size_t
i
;
size_t
i
;
unsigned
found
=
0
;
if
((
error
=
packfile_refresh_all
(
backend
))
<
GIT_SUCCESS
)
if
((
error
=
packfile_refresh_all
(
backend
))
<
GIT_SUCCESS
)
return
git__rethrow
(
error
,
"Failed to find pack entry"
);
return
git__rethrow
(
error
,
"Failed to find pack entry"
);
unsigned
found
=
0
;
if
(
backend
->
last_found
)
{
if
(
backend
->
last_found
)
{
error
=
pack_entry_find1
(
e
,
backend
->
last_found
,
short_oid
,
len
);
error
=
pack_entry_find1
(
e
,
backend
->
last_found
,
short_oid
,
len
);
if
(
error
==
GIT_EAMBIGUOUSOIDPREFIX
)
{
if
(
error
==
GIT_EAMBIGUOUSOIDPREFIX
)
{
...
...
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