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
69fb8979
Commit
69fb8979
authored
Nov 21, 2020
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
midx: use GIT_ASSERT
parent
f16f2927
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
src/midx.c
+7
-4
src/midx.h
+1
-1
No files found.
src/midx.c
View file @
69fb8979
...
...
@@ -181,7 +181,7 @@ int git_midx_parse(
chunk_object_offsets
=
{
0
},
chunk_object_large_offsets
=
{
0
};
assert
(
idx
);
GIT_ASSERT_ARG
(
idx
);
if
(
size
<
sizeof
(
struct
git_midx_header
)
+
20
)
return
midx_error
(
"multi-pack index is too short"
);
...
...
@@ -338,7 +338,7 @@ int git_midx_entry_find(
const
unsigned
char
*
object_offset
;
off64_t
offset
;
assert
(
idx
);
GIT_ASSERT_ARG
(
idx
);
hi
=
ntohl
(
idx
->
oid_fanout
[(
int
)
short_oid
->
id
[
0
]]);
lo
=
((
short_oid
->
id
[
0
]
==
0x0
)
?
0
:
ntohl
(
idx
->
oid_fanout
[(
int
)
short_oid
->
id
[
0
]
-
1
]));
...
...
@@ -399,13 +399,16 @@ int git_midx_entry_find(
return
0
;
}
void
git_midx_close
(
git_midx_file
*
idx
)
int
git_midx_close
(
git_midx_file
*
idx
)
{
assert
(
idx
);
GIT_ASSERT_ARG
(
idx
);
if
(
idx
->
index_map
.
data
)
git_futils_mmap_free
(
&
idx
->
index_map
);
git_vector_free
(
&
idx
->
packfile_names
);
return
0
;
}
void
git_midx_free
(
git_midx_file
*
idx
)
...
...
src/midx.h
View file @
69fb8979
...
...
@@ -71,7 +71,7 @@ int git_midx_entry_find(
git_midx_file
*
idx
,
const
git_oid
*
short_oid
,
size_t
len
);
void
git_midx_close
(
git_midx_file
*
idx
);
int
git_midx_close
(
git_midx_file
*
idx
);
void
git_midx_free
(
git_midx_file
*
idx
);
/* This is exposed for use in the fuzzers. */
...
...
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