path: root/builtin/add.c
diff options
authorJunio C Hamano <>2018-05-30 05:04:05 (GMT)
committerJunio C Hamano <>2018-05-30 05:04:05 (GMT)
commit2f76ebc93ca6bfc2aba1be330aabe391a7d093d2 (patch)
tree2aba711da4a334aeaa374345e1714973d1e92315 /builtin/add.c
parent0e7af5f6d16a4cef7d981ac9631f35d146904eca (diff)
parent0fa5a2ed8d9f6d987f1ea479fe8ea56a26b89303 (diff)
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
Diffstat (limited to 'builtin/add.c')
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/add.c b/builtin/add.c
index c9e2619..8a155dd 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -265,8 +265,6 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
return 0;
-static struct lock_file lock_file;
static const char ignore_error[] =
N_("The following paths are ignored by one of your .gitignore files:\n");
@@ -393,6 +391,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
int add_new_files;
int require_pathspec;
char *seen = NULL;
+ struct lock_file lock_file = LOCK_INIT;
git_config(add_config, NULL);