git/pack-write.c

#define USE_THE_REPOSITORY_VARIABLE

#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 "object-file.h"
#include "pack-mtimes.h"
#include "pack-objects.h"
#include "pack-revindex.h"
#include "path.h"
#include "repository.h"
#include "strbuf.h"

void reset_pack_idx_option(struct pack_idx_option *opts)
{}

static int sha1_compare(const void *_a, const void *_b)
{}

static int cmp_uint32(const void *a_, const void *b_)
{}

static int need_large_offset(off_t offset, const struct pack_idx_option *opts)
{}

/*
 * The *sha1 contains the pack content SHA1 hash.
 * The objects array passed in will be sorted by SHA1 on exit.
 */
const char *write_idx_file(const char *index_name, struct pack_idx_entry **objects,
			   int nr_objects, const struct pack_idx_option *opts,
			   const unsigned char *sha1)
{}

static int pack_order_cmp(const void *va, const void *vb, void *ctx)
{}

static void write_rev_header(struct hashfile *f)
{}

static void write_rev_index_positions(struct hashfile *f,
				      uint32_t *pack_order,
				      uint32_t nr_objects)
{}

static void write_rev_trailer(struct hashfile *f, const unsigned char *hash)
{}

char *write_rev_file(const char *rev_name,
		     struct pack_idx_entry **objects,
		     uint32_t nr_objects,
		     const unsigned char *hash,
		     unsigned flags)
{}

char *write_rev_file_order(const char *rev_name,
			   uint32_t *pack_order,
			   uint32_t nr_objects,
			   const unsigned char *hash,
			   unsigned flags)
{}

static void write_mtimes_header(struct hashfile *f)
{}

/*
 * Writes the object mtimes of "objects" for use in a .mtimes file.
 * Note that objects must be in lexicographic (index) order, which is
 * the expected ordering of these values in the .mtimes file.
 */
static void write_mtimes_objects(struct hashfile *f,
				 struct packing_data *to_pack,
				 struct pack_idx_entry **objects,
				 uint32_t nr_objects)
{}

static void write_mtimes_trailer(struct hashfile *f, 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)
{}

off_t write_pack_header(struct hashfile *f, uint32_t nr_entries)
{}

/*
 * Update pack header with object_count and compute new SHA1 for pack data
 * associated to pack_fd, and write that SHA1 at the end.  That new SHA1
 * is also returned in new_pack_sha1.
 *
 * If partial_pack_sha1 is non null, then the SHA1 of the existing pack
 * (without the header update) is computed and validated against the
 * one provided in partial_pack_sha1.  The validation is performed at
 * partial_pack_offset bytes in the pack file.  The SHA1 of the remaining
 * data (i.e. from partial_pack_offset to the end) is then computed and
 * returned in partial_pack_sha1.
 *
 * Note that new_pack_sha1 is updated last, so both new_pack_sha1 and
 * partial_pack_sha1 can refer to the same buffer if the caller is not
 * interested in the resulting SHA1 of pack data above partial_pack_offset.
 */
void fixup_pack_header_footer(int pack_fd,
			 unsigned char *new_pack_hash,
			 const char *pack_name,
			 uint32_t object_count,
			 unsigned char *partial_pack_hash,
			 off_t partial_pack_offset)
{}

char *index_pack_lockfile(int ip_out, int *is_well_formed)
{}

/*
 * The per-object header is a pretty dense thing, which is
 *  - first byte: low four bits are "size", then three bits of "type",
 *    and the high bit is "size continues".
 *  - each byte afterwards: low seven bits are size continuation,
 *    with the high bit being "size continues"
 */
int encode_in_pack_object_header(unsigned char *hdr, int hdr_len,
				 enum object_type type, uintmax_t size)
{}

struct hashfile *create_tmp_packfile(char **pack_tmp_name)
{}

static void rename_tmp_packfile(struct strbuf *name_prefix, const char *source,
				const char *ext)
{}

void rename_tmp_packfile_idx(struct strbuf *name_buffer,
			     char **idx_tmp_name)
{}

void stage_tmp_packfiles(struct strbuf *name_buffer,
			 const char *pack_tmp_name,
			 struct pack_idx_entry **written_list,
			 uint32_t nr_written,
			 struct packing_data *to_pack,
			 struct pack_idx_option *pack_idx_opts,
			 unsigned char hash[],
			 char **idx_tmp_name)
{}

void write_promisor_file(const char *promisor_name, struct ref **sought, int nr_sought)
{}