safe_create_leading_directories(): set errno on SCLD_EXISTS
commit204a047f23462e4931eb00c367818d9870237827
authorMichael Haggerty <mhagger@alum.mit.edu>
Fri, 6 Jan 2017 16:22:25 +0000 (6 17:22 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sun, 8 Jan 2017 03:30:08 +0000 (7 19:30 -0800)
tree73b6d90e28f537ffe36ca8f8b3627aba14da6329
parent029443070a4e5b0290a2d09f3707bc486d84a961
safe_create_leading_directories(): set errno on SCLD_EXISTS

The exit path for SCLD_EXISTS wasn't setting errno, which some callers
use to generate error messages for the user. Fix the problem and
document that the function sets errno correctly to help avoid similar
regressions in the future.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h
sha1_file.c