Re: [PATCH nd/split-index] fixup! read-cache: new API write_locked_index instead of write_index/write_cache
- From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
- Date
- Jun 2, 2014, 15:12 UTC
- Message-ID
- <538C9441.3010804@ramsay1.demon.co.uk>
- In-Reply-To
- <1401583635-1332-1-git-send-email-pclouds@gmail.com>
On 01/06/14 01:47, Nguyễn Thái Ngọc Duy wrote:
Show 23 quoted lines
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
> I intended it resend the series after the comments I received, but it
> looks like Junio has picked up all comments except this one, so
> here's the fix.
>
> sequencer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sequencer.c b/sequencer.c
> index 377c877..4b709db 100644
> --- a/sequencer.c
> +++ b/sequencer.c
> @@ -672,7 +672,7 @@ static void prepare_revs(struct replay_opts *opts)
> static void read_and_refresh_cache(struct replay_opts *opts)
> {
> static struct lock_file index_lock;
> - hold_locked_index(&index_lock, 0);
> + int index_fd = hold_locked_index(&index_lock, 0);
> if (read_index_preload(&the_index, NULL) < 0)
> die(_("git %s: failed to read the index"), action_name(opts));
> refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED, NULL, NULL, NULL);
> Yep, this silences sparse. I would have declared the variable to be (say) fd (and changed the _use_ site as well, of course!), rather than once again hiding the index_fd() global function. However, this is perfectly fine as-is.
The actual culprit is the index_fd() global function, but renaming it now is probably not worth the code churn (and I'm lazy). ;-)
Thanks!
ATB, Ramsay Jones