summaryrefslogtreecommitdiff
path: root/lockfile.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2015-08-10 11:47:39 +0200
committerJunio C Hamano <gitster@pobox.com>2015-08-10 12:57:14 -0700
commitb4fb09e4da53bfc6c720337142af5db3204736d5 (patch)
treeee21234e6668f9a03d08d0713b3a27df4e3d444a /lockfile.c
parentc99a4c2db3053e4fb6a43870f5c747f858b0f58f (diff)
downloadgit-b4fb09e4da53bfc6c720337142af5db3204736d5.tar.gz
lockfile: add accessor get_lock_file_path()
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'lockfile.c')
-rw-r--r--lockfile.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lockfile.c b/lockfile.c
index df9c704f51..5e954baf07 100644
--- a/lockfile.c
+++ b/lockfile.c
@@ -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)