lockfile: add accessor get_lock_file_path()
[gitweb.git] / lockfile.c
index df9c704f51d6f2147421e67a70f9f91034ebb1d2..5e954baf07a5266a7abe341fadf647da55a28705 100644 (file)
@@ -364,6 +364,13 @@ FILE *fdopen_lock_file(struct lock_file *lk, const char *mode)
        return lk->fp;
 }
 
+const char *get_lock_file_path(struct lock_file *lk)
+{
+       if (!lk->active)
+               die("BUG: get_lock_file_path() called for unlocked object");
+       return lk->filename.buf;
+}
+
 int get_lock_file_fd(struct lock_file *lk)
 {
        if (!lk->active)