lockfile: add accessors get_lock_file_fd() and get_lock_file_fp()

We are about to move those members, so change client code to read them
through accessor functions.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Michael Haggerty
2015-08-10 11:47:38 +02:00
committed by Junio C Hamano
parent e54c347c1c
commit c99a4c2db3
5 changed files with 26 additions and 7 deletions

View File

@ -52,7 +52,7 @@ static void print_entry(struct credential *c)
static void print_line(struct strbuf *buf)
{
strbuf_addch(buf, '\n');
write_or_die(credential_lock.fd, buf->buf, buf->len);
write_or_die(get_lock_file_fd(&credential_lock), buf->buf, buf->len);
}
static void rewrite_credential_file(const char *fn, struct credential *c,