author | Junio C Hamano <gitster@pobox.com> | |
Tue, 2 Sep 2008 21:10:15 +0000 (14:10 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 4 Sep 2008 05:35:32 +0000 (22:35 -0700) | ||
commit | 5f0bdf50c2eb640b4321acb9b34b3cb401f5ddfb | |
tree | 43d9939712c4793f4f68edd8f851917c7d5622e7 | tree | snapshot |
parent | de5d560c99c96e2955fb4d1d8a8fa6b469926292 | commit | diff |
safe_create_leading_directories(): make it about "leading" directories
We used to allow callers to pass "foo/bar/" to make sure both "foo" and
"foo/bar" exist and have good permissions, but this interface is too error
prone. If a caller mistakenly passes a path with trailing slashes
(perhaps it forgot to verify the user input) even when it wants to later
mkdir "bar" itself, it will find that it cannot mkdir "bar". If such a
caller does not bother to check the error for EEXIST, it may even
errorneously die().
Because we have no existing callers to use that obscure feature, this
patch removes it to avoid confusion.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
We used to allow callers to pass "foo/bar/" to make sure both "foo" and
"foo/bar" exist and have good permissions, but this interface is too error
prone. If a caller mistakenly passes a path with trailing slashes
(perhaps it forgot to verify the user input) even when it wants to later
mkdir "bar" itself, it will find that it cannot mkdir "bar". If such a
caller does not bother to check the error for EEXIST, it may even
errorneously die().
Because we have no existing callers to use that obscure feature, this
patch removes it to avoid confusion.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_file.c | diff | blob | history |