Re: [PATCH 05/23] midx: write header information to lockfile
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Jun 7, 2018, 17:35 UTC
- Message-ID
- <CACsJy8DZpe0=onuKxmM2NTN9SwKhwonv75E9T6vdB0S-WOdoDQ@mail.gmail.com>
- In-Reply-To
- <20180607140338.32440-6-dstolee@microsoft.com>
On Thu, Jun 7, 2018 at 4:03 PM, Derrick Stolee <stolee@gmail.com> wrote:
Show 7 quoted lines
> +static char *get_midx_filename(const char *object_dir)
> +{
> + struct strbuf midx_name = STRBUF_INIT;
> + strbuf_addstr(&midx_name, object_dir);
> + strbuf_addstr(&midx_name, "/pack/multi-pack-index");
> + return strbuf_detach(&midx_name, NULL);
> +}I think this whole function can be written as xstrfmt("%s/pack/multi-pack-index", object_dir);
Show 6 quoted lines
> +
> +static size_t write_midx_header(struct hashfile *f,
> + unsigned char num_chunks,
> + uint32_t num_packs)
> +{
> + char byte_values[4];unsigned char just to be on the safe side? 'char' is signed on ARM if I remember correctly.
-- Duy