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
8af4d074
Commit
8af4d074
authored
Sep 29, 2011
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
odb: Let users decide compression level for the loose ODB
parent
72bdfdbc
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
5 deletions
+12
-5
include/git2/odb_backend.h
+1
-1
src/odb.c
+1
-1
src/odb_loose.c
+10
-3
No files found.
include/git2/odb_backend.h
View file @
8af4d074
...
...
@@ -93,7 +93,7 @@ typedef enum {
}
git_odb_streammode
;
GIT_EXTERN
(
int
)
git_odb_backend_pack
(
git_odb_backend
**
backend_out
,
const
char
*
objects_dir
);
GIT_EXTERN
(
int
)
git_odb_backend_loose
(
git_odb_backend
**
backend_out
,
const
char
*
objects_dir
);
GIT_EXTERN
(
int
)
git_odb_backend_loose
(
git_odb_backend
**
backend_out
,
const
char
*
objects_dir
,
int
compression_level
,
int
do_fsync
);
GIT_END_DECL
...
...
src/odb.c
View file @
8af4d074
...
...
@@ -321,7 +321,7 @@ static int add_default_backends(git_odb *db, const char *objects_dir, int as_alt
int
error
;
/* add the loose object backend */
error
=
git_odb_backend_loose
(
&
loose
,
objects_dir
);
error
=
git_odb_backend_loose
(
&
loose
,
objects_dir
,
-
1
,
0
);
if
(
error
<
GIT_SUCCESS
)
return
error
;
...
...
src/odb_loose.c
View file @
8af4d074
...
...
@@ -807,7 +807,11 @@ static void loose_backend__free(git_odb_backend *_backend)
free
(
backend
);
}
int
git_odb_backend_loose
(
git_odb_backend
**
backend_out
,
const
char
*
objects_dir
)
int
git_odb_backend_loose
(
git_odb_backend
**
backend_out
,
const
char
*
objects_dir
,
int
compression_level
,
int
do_fsync
)
{
loose_backend
*
backend
;
...
...
@@ -821,8 +825,11 @@ int git_odb_backend_loose(git_odb_backend **backend_out, const char *objects_dir
return
GIT_ENOMEM
;
}
backend
->
object_zlib_level
=
Z_BEST_SPEED
;
backend
->
fsync_object_files
=
0
;
if
(
compression_level
<
0
)
compression_level
=
Z_BEST_SPEED
;
backend
->
object_zlib_level
=
compression_level
;
backend
->
fsync_object_files
=
do_fsync
;
backend
->
parent
.
read
=
&
loose_backend__read
;
backend
->
parent
.
write
=
&
loose_backend__write
;
...
...
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