10
10
11
11
static int delta_base_offset = 1 ;
12
12
static int pack_kept_objects = -1 ;
13
+ static int write_bitmaps = -1 ;
13
14
static char * packdir , * packtmp ;
14
15
15
16
static const char * const git_repack_usage [] = {
@@ -27,6 +28,10 @@ static int repack_config(const char *var, const char *value, void *cb)
27
28
pack_kept_objects = git_config_bool (var , value );
28
29
return 0 ;
29
30
}
31
+ if (!strcmp (var , "pack.writebitmaps" )) {
32
+ write_bitmaps = git_config_bool (var , value );
33
+ return 0 ;
34
+ }
30
35
return git_default_config (var , value , cb );
31
36
}
32
37
@@ -149,7 +154,6 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
149
154
int no_update_server_info = 0 ;
150
155
int quiet = 0 ;
151
156
int local = 0 ;
152
- int write_bitmap = -1 ;
153
157
154
158
struct option builtin_repack_options [] = {
155
159
OPT_BIT ('a' , NULL , & pack_everything ,
@@ -168,7 +172,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
168
172
OPT__QUIET (& quiet , N_ ("be quiet" )),
169
173
OPT_BOOL ('l' , "local" , & local ,
170
174
N_ ("pass --local to git-pack-objects" )),
171
- OPT_BOOL ('b' , "write-bitmap-index" , & write_bitmap ,
175
+ OPT_BOOL ('b' , "write-bitmap-index" , & write_bitmaps ,
172
176
N_ ("write bitmap index" )),
173
177
OPT_STRING (0 , "unpack-unreachable" , & unpack_unreachable , N_ ("approxidate" ),
174
178
N_ ("with -A, do not loosen objects older than this" )),
@@ -191,7 +195,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
191
195
git_repack_usage , 0 );
192
196
193
197
if (pack_kept_objects < 0 )
194
- pack_kept_objects = write_bitmap ;
198
+ pack_kept_objects = write_bitmaps > 0 ;
195
199
196
200
packdir = mkpathdup ("%s/pack" , get_object_directory ());
197
201
packtmp = mkpathdup ("%s/.tmp-%d-pack" , packdir , (int )getpid ());
@@ -217,9 +221,9 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
217
221
argv_array_pushf (& cmd_args , "--no-reuse-delta" );
218
222
if (no_reuse_object )
219
223
argv_array_pushf (& cmd_args , "--no-reuse-object" );
220
- if (write_bitmap >= 0 )
224
+ if (write_bitmaps >= 0 )
221
225
argv_array_pushf (& cmd_args , "--%swrite-bitmap-index" ,
222
- write_bitmap ? "" : "no-" );
226
+ write_bitmaps ? "" : "no-" );
223
227
224
228
if (pack_everything & ALL_INTO_ONE ) {
225
229
get_non_kept_pack_filenames (& existing_packs );
0 commit comments