lock_file: make function-local locks non-static
[gitweb.git] / builtin / difftool.c
index bcc79d1888f2217bcb380ffb1e7178c100a41e8e..d9a0fecffcfb9f1169c94c321191e9319e943013 100644 (file)
@@ -610,7 +610,7 @@ static int run_dir_diff(const char *extcmd, int symlinks, const char *prefix,
                        continue;
 
                if (!indices_loaded) {
-                       static struct lock_file lock;
+                       struct lock_file lock = LOCK_INIT;
                        strbuf_reset(&buf);
                        strbuf_addf(&buf, "%s/wtindex", tmpdir);
                        if (hold_lock_file_for_update(&lock, buf.buf, 0) < 0 ||