Re: [PATCH] clone: error specifically with --local and symlinked objects
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Apr 6, 2023, 21:27 UTC
- Message-ID
- <ZC85ODogr79t0ZXZ@nand.local>
- In-Reply-To
- <xmqq7curxk22.fsf@gitster.g>
On Tue, Apr 04, 2023 at 05:13:41PM -0700, Junio C Hamano wrote:
Show 6 quoted lines
> * if lstat() succeeds, but the path is *not* a directory; errno is > explicitly set to ENOTDIR. Unfortunately, if lstat(2) failed > with ENOTDIR (e.g. dir_iterator_begin() gets called with a path > whose leading component is not a directory), the caller will also > see ENOTDIR, but the distinction may not matter in practice. I > haven't thought things through.
Yeah. The real tragedy here is that there's no way to signal that a file *is* a symbolic link and represent that as an error code in errno.
So I think the best that we can do here is to continue to report ENOTDIR, and have the caller figure out what to do with it.
Thanks, Taylor