refs.c: log_ref_write should try to return meaningful errno
commitdc615de8610c807633c63313937056bf45df0b8f
authorRonnie Sahlberg <sahlberg@google.com>
Fri, 20 Jun 2014 14:42:55 +0000 (20 07:42 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 14 Jul 2014 18:54:42 +0000 (14 11:54 -0700)
treea11c6e51b933a942f4f01335ebd3513d85168eb1
parent76d70dc0c63fe89958308f249136864aec5cdf03
refs.c: log_ref_write should try to return meaningful errno

Making errno from write_ref_sha1() meaningful, which should fix

* a bug in "git checkout -b" where it prints strerror(errno)
  despite errno possibly being zero or clobbered

* a bug in "git fetch"'s s_update_ref, which trusts the result of an
  errno == ENOTDIR check to detect D/F conflicts

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>
refs.c