diff options
Diffstat (limited to 'pack-write.c')
-rw-r--r-- | pack-write.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/pack-write.c b/pack-write.c index 00787e306d..80ecfa544c 100644 --- a/pack-write.c +++ b/pack-write.c @@ -1,12 +1,16 @@ -#include "cache.h" +#include "git-compat-util.h" +#include "environment.h" +#include "gettext.h" +#include "hex.h" #include "pack.h" #include "csum-file.h" #include "remote.h" #include "chunk-format.h" #include "pack-mtimes.h" -#include "oidmap.h" -#include "chunk-format.h" #include "pack-objects.h" +#include "pack-revindex.h" +#include "path.h" +#include "strbuf.h" void reset_pack_idx_option(struct pack_idx_option *opts) { @@ -310,13 +314,13 @@ static void write_mtimes_trailer(struct hashfile *f, const unsigned char *hash) hashwrite(f, hash, the_hash_algo->rawsz); } -static const char *write_mtimes_file(struct packing_data *to_pack, - struct pack_idx_entry **objects, - uint32_t nr_objects, - const unsigned char *hash) +static char *write_mtimes_file(struct packing_data *to_pack, + struct pack_idx_entry **objects, + uint32_t nr_objects, + const unsigned char *hash) { struct strbuf tmp_file = STRBUF_INIT; - const char *mtimes_name; + char *mtimes_name; struct hashfile *f; int fd; @@ -542,7 +546,7 @@ void stage_tmp_packfiles(struct strbuf *name_buffer, char **idx_tmp_name) { const char *rev_tmp_name = NULL; - const char *mtimes_tmp_name = NULL; + char *mtimes_tmp_name = NULL; if (adjust_shared_perm(pack_tmp_name)) die_errno("unable to make temporary pack file readable"); @@ -566,6 +570,9 @@ void stage_tmp_packfiles(struct strbuf *name_buffer, rename_tmp_packfile(name_buffer, rev_tmp_name, "rev"); if (mtimes_tmp_name) rename_tmp_packfile(name_buffer, mtimes_tmp_name, "mtimes"); + + free((char *)rev_tmp_name); + free(mtimes_tmp_name); } void write_promisor_file(const char *promisor_name, struct ref **sought, int nr_sought) |