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

@ -233,8 +233,6 @@ static int check_local_mod(struct object_id *head, int index_only)
return errs;
}
static struct lock_file lock_file;
static int show_only = 0, force = 0, index_only = 0, recursive = 0, quiet = 0;
static int ignore_unmatch = 0;
@ -251,6 +249,7 @@ static struct option builtin_rm_options[] = {
int cmd_rm(int argc, const char **argv, const char *prefix)
{
struct lock_file lock_file = LOCK_INIT;
int i;
struct pathspec pathspec;
char *seen;