refs.c: make sure log_ref_setup returns a meaningful errno

Making errno when returning from log_ref_setup() meaningful,

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Michael Haggerty <mhagger@alum.mit.edu>
This commit is contained in:
Ronnie Sahlberg
2014-06-20 07:42:50 -07:00
committed by Junio C Hamano
parent 60bca085c8
commit bd3b02daec
2 changed files with 22 additions and 9 deletions

4
refs.h
View File

@ -158,7 +158,9 @@ extern void unlock_ref(struct ref_lock *lock);
/** Writes sha1 into the ref specified by the lock. **/
extern int write_ref_sha1(struct ref_lock *lock, const unsigned char *sha1, const char *msg);
/** Setup reflog before using. **/
/*
* Setup reflog before using. Set errno to something meaningful on failure.
*/
int log_ref_setup(const char *refname, char *logfile, int bufsize);
/** Reads log for the value of ref during at_time. **/