Re: [WIP v2 5/5] mv: use update_sparsity() after touching sparse contents
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- May 27, 2022, 12:10 UTC
- Message-ID
- <220527.86sfov2n26.gmgdl@evledraar.gmail.com>
- In-Reply-To
- <20220527100804.209890-6-shaoxuan.yuan02@gmail.com>
On Fri, May 27 2022, Shaoxuan Yuan wrote:
Show 10 quoted lines
> + if (sparse_moved) {
> + struct unpack_trees_options o;
> + memset(&o, 0, sizeof(o));
> + o.verbose_update = isatty(2);
> + o.update = 1;
> + o.head_idx = -1;
> + o.src_index = &the_index;
> + o.dst_index = &the_index;
> + o.skip_sparse_checkout = 0;
> + o.pl = the_index.sparse_checkout_patterns;You can drop the memset here and use the designated init syntax instead. I.e. "struct x o = { .verbose_update .... };"