author | Jeff King <peff@peff.net> | |
Mon, 25 May 2009 10:37:15 +0000 (06:37 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 25 May 2009 19:06:54 +0000 (12:06 -0700) | ||
commit | f475e08edbbabe38bd758fd42f08f646551468d9 | |
tree | 0e28a879e1435283fe35d12857e04b3c94b09f33 | tree | snapshot |
parent | f5d4c4d0f19084a2d48f55f2f42cac25696a34f5 | commit | diff |
lock_ref: inform callers of unavailable ref
One of the ways that locking might fail is that there is a
DF conflict between two refs (e.g., you want to lock
"foo/bar" but "foo" already exists). In this case, we return
an error, but there is no way for the caller to know the
specific problem.
This patch sets errno to ENOTDIR, which is the most sensible
code. It's what we would see if the refs were stored purely
in the filesystem (but these days we must check the
namespace manually due to packed refs).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
One of the ways that locking might fail is that there is a
DF conflict between two refs (e.g., you want to lock
"foo/bar" but "foo" already exists). In this case, we return
an error, but there is no way for the caller to know the
specific problem.
This patch sets errno to ENOTDIR, which is the most sensible
code. It's what we would see if the refs were stored purely
in the filesystem (but these days we must check the
namespace manually due to packed refs).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c | diff | blob | history |