git/refs
Martin Ågren b227586831 lock_file: make function-local locks non-static
Placing `struct lock_file`s on the stack used to be a bad idea, because
the temp- and lockfile-machinery would keep a pointer into the struct.
But after 076aa2cbd (tempfile: auto-allocate tempfiles on heap,
2017-09-05), we can safely have lockfiles on the stack. (This applies
even if a user returns early, leaving a locked lock behind.)

These `struct lock_file`s are local to their respective functions and we
can drop their staticness.

For good measure, I have inspected these sites and come to believe that
they always release the lock, with the possible exception of bailing out
using `die()` or `exit()` or by returning from a `cmd_foo()`.

As pointed out by Jeff King, it would be bad if someone held on to a
`struct lock_file *` for some reason. After some grepping, I agree with
his findings: no-one appears to be doing that.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-05-10 14:54:45 +09:00
..
files-backend.c lock_file: make function-local locks non-static 2018-05-10 14:54:45 +09:00
iterator.c prefix_ref_iterator: break when we leave the prefix 2017-09-14 15:19:07 +09:00
packed-backend.c Merge branch 'kg/packed-ref-cache-fix' 2018-02-15 14:55:42 -08:00
packed-backend.h files-backend: don't rewrite the packed-refs file unnecessarily 2017-10-30 09:45:15 +09:00
ref-cache.c Use MOVE_ARRAY 2018-01-22 11:32:51 -08:00
ref-cache.h ref_cache: remove support for storing peeled values 2017-09-25 18:02:46 +09:00
refs-internal.h refs: update some more docs to use "oid" rather than "sha1" 2017-11-06 10:31:08 +09:00