1
- #define USE_THE_REPOSITORY_VARIABLE
2
-
3
1
#include "git-compat-util.h"
4
2
#include "environment.h"
5
3
#include "gettext.h"
@@ -211,9 +209,10 @@ static void write_rev_index_positions(struct hashfile *f,
211
209
hashwrite_be32 (f , pack_order [i ]);
212
210
}
213
211
214
- static void write_rev_trailer (struct hashfile * f , const unsigned char * hash )
212
+ static void write_rev_trailer (const struct git_hash_algo * hash_algo ,
213
+ struct hashfile * f , const unsigned char * hash )
215
214
{
216
- hashwrite (f , hash , the_hash_algo -> rawsz );
215
+ hashwrite (f , hash , hash_algo -> rawsz );
217
216
}
218
217
219
218
char * write_rev_file (const struct git_hash_algo * hash_algo ,
@@ -286,7 +285,7 @@ char *write_rev_file_order(const struct git_hash_algo *hash_algo,
286
285
write_rev_header (hash_algo , f );
287
286
288
287
write_rev_index_positions (f , pack_order , nr_objects );
289
- write_rev_trailer (f , hash );
288
+ write_rev_trailer (hash_algo , f , hash );
290
289
291
290
if (adjust_shared_perm (path ) < 0 )
292
291
die (_ ("failed to make %s readable" ), path );
@@ -298,11 +297,12 @@ char *write_rev_file_order(const struct git_hash_algo *hash_algo,
298
297
return path ;
299
298
}
300
299
301
- static void write_mtimes_header (struct hashfile * f )
300
+ static void write_mtimes_header (const struct git_hash_algo * hash_algo ,
301
+ struct hashfile * f )
302
302
{
303
303
hashwrite_be32 (f , MTIMES_SIGNATURE );
304
304
hashwrite_be32 (f , MTIMES_VERSION );
305
- hashwrite_be32 (f , oid_version (the_hash_algo ));
305
+ hashwrite_be32 (f , oid_version (hash_algo ));
306
306
}
307
307
308
308
/*
@@ -322,12 +322,14 @@ static void write_mtimes_objects(struct hashfile *f,
322
322
}
323
323
}
324
324
325
- static void write_mtimes_trailer (struct hashfile * f , const unsigned char * hash )
325
+ static void write_mtimes_trailer (const struct git_hash_algo * hash_algo ,
326
+ struct hashfile * f , const unsigned char * hash )
326
327
{
327
- hashwrite (f , hash , the_hash_algo -> rawsz );
328
+ hashwrite (f , hash , hash_algo -> rawsz );
328
329
}
329
330
330
- static char * write_mtimes_file (struct packing_data * to_pack ,
331
+ static char * write_mtimes_file (const struct git_hash_algo * hash_algo ,
332
+ struct packing_data * to_pack ,
331
333
struct pack_idx_entry * * objects ,
332
334
uint32_t nr_objects ,
333
335
const unsigned char * hash )
@@ -344,9 +346,9 @@ static char *write_mtimes_file(struct packing_data *to_pack,
344
346
mtimes_name = strbuf_detach (& tmp_file , NULL );
345
347
f = hashfd (fd , mtimes_name );
346
348
347
- write_mtimes_header (f );
349
+ write_mtimes_header (hash_algo , f );
348
350
write_mtimes_objects (f , to_pack , objects , nr_objects );
349
- write_mtimes_trailer (f , hash );
351
+ write_mtimes_trailer (hash_algo , f , hash );
350
352
351
353
if (adjust_shared_perm (mtimes_name ) < 0 )
352
354
die (_ ("failed to make %s readable" ), mtimes_name );
@@ -575,8 +577,8 @@ void stage_tmp_packfiles(const struct git_hash_algo *hash_algo,
575
577
hash , pack_idx_opts -> flags );
576
578
577
579
if (pack_idx_opts -> flags & WRITE_MTIMES ) {
578
- mtimes_tmp_name = write_mtimes_file (to_pack , written_list ,
579
- nr_written ,
580
+ mtimes_tmp_name = write_mtimes_file (hash_algo , to_pack ,
581
+ written_list , nr_written ,
580
582
hash );
581
583
}
582
584
0 commit comments