Files
git/builtin
Martin Ågren 02ae242fdd checkout-index: simplify locking logic
`newfd` starts out negative. If we then take the lock, `newfd` will
become non-negative. We later check for exactly that property before
calling `write_locked_index()`. That is, we are simply using `newfd` as
a boolean to keep track of whether we took the lock or not. (We always
use `newfd` and `lock_file` together, so they really are mirroring each
other.)

Drop `newfd` and check with `is_lock_file_locked()` instead. While at
it, move the `static struct lock_file` into `cmd_checkout_index()` and
make it non-static. It is only used in this function, and after
076aa2cbd (tempfile: auto-allocate tempfiles on heap, 2017-09-05), we
can have lockfiles on the stack.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-10-06 10:07:18 +09:00
..
2017-10-06 10:07:17 +09:00
2016-11-22 13:55:20 -08:00
2017-09-06 13:11:25 +09:00
2017-09-28 14:47:53 +09:00
2017-06-24 14:28:41 -07:00
2017-09-29 11:23:43 +09:00
2017-10-06 10:07:17 +09:00
2017-09-29 11:23:43 +09:00
2017-03-31 08:33:56 -07:00
2017-08-26 22:55:09 -07:00
2017-09-29 11:23:43 +09:00
2017-09-25 15:24:09 +09:00
2017-09-25 15:24:07 +09:00
2017-06-24 14:28:41 -07:00
2017-06-24 14:28:41 -07:00
2017-09-19 10:47:57 +09:00
2017-08-03 13:11:02 -07:00
2017-09-19 10:47:52 +09:00
2017-08-26 22:55:09 -07:00
2017-08-22 10:29:03 -07:00
2017-06-24 14:28:41 -07:00
2017-09-19 10:47:55 +09:00
2017-08-03 13:11:02 -07:00
2017-08-22 10:29:03 -07:00
2017-01-23 18:51:56 -08:00
2017-09-19 10:47:55 +09:00
2017-06-24 14:28:41 -07:00