Merge branch 'ma/lockfile-cleanup'

Code clean-up to adjust to a more recent lockfile API convention that
allows lockfile instances kept on the stack.

* ma/lockfile-cleanup:
  lock_file: move static locks into functions
  lock_file: make function-local locks non-static
  refs.c: do not die if locking fails in `delete_pseudoref()`
  refs.c: do not die if locking fails in `write_pseudoref()`
  t/helper/test-write-cache: clean up lock-handling
This commit is contained in:
Junio C Hamano
2018-05-30 14:04:05 +09:00
18 changed files with 32 additions and 38 deletions

View File

@ -4,10 +4,10 @@
#include "tree.h"
#include "cache-tree.h"
static struct lock_file index_lock;
int cmd__scrap_cache_tree(int ac, const char **av)
{
struct lock_file index_lock = LOCK_INIT;
setup_git_directory();
hold_locked_index(&index_lock, LOCK_DIE_ON_ERROR);
if (read_cache() < 0)