Re: [PATCH v2 10/12] read-cache: drop explicit `CLOSE_LOCK`-flag

2017-10-06 Thread Martin Ågren
On 6 October 2017 at 03:39, Junio C Hamano wrote: > Martin Ågren writes: > >> diff --git a/read-cache.c b/read-cache.c >> index 65f4fe837..1c917eba9 100644 >> --- a/read-cache.c >> +++ b/read-cache.c >> @@ -2343,14 +2343,13 @@ static int

Re: [PATCH v2 10/12] read-cache: drop explicit `CLOSE_LOCK`-flag

2017-10-05 Thread Junio C Hamano
Martin Ågren writes: > diff --git a/read-cache.c b/read-cache.c > index 65f4fe837..1c917eba9 100644 > --- a/read-cache.c > +++ b/read-cache.c > @@ -2343,14 +2343,13 @@ static int do_write_locked_index(struct index_state > *istate, struct lock_file *l > int ret =

[PATCH v2 10/12] read-cache: drop explicit `CLOSE_LOCK`-flag

2017-10-05 Thread Martin Ågren
`write_locked_index()` takes two flags: `COMMIT_LOCK` and `CLOSE_LOCK`. At most one is allowed. But it is also possible to use no flag, i.e., `0`. But when `write_locked_index()` calls `do_write_index()`, the temporary file, a.k.a. the lockfile, will be closed. So passing `0` is effectively the