git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Taylor Blau <me@ttaylorr.com>
To: Glen Choo via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Glen Choo <chooglen@google.com>
Subject: Re: [PATCH v2] clone: error specifically with --local and symlinked objects
Date: Mon, 10 Apr 2023 21:58:36 -0400	[thread overview]
Message-ID: <ZDS+zJAilFqxMSqa@nand.local> (raw)
In-Reply-To: <pull.1488.v2.git.git.1681165130765.gitgitgadget@gmail.com>

On Mon, Apr 10, 2023 at 10:18:50PM +0000, Glen Choo via GitGitGadget wrote:
> diff --git a/builtin/clone.c b/builtin/clone.c
> index 462c286274c..46f6f689c85 100644
> --- a/builtin/clone.c
> +++ b/builtin/clone.c
> @@ -327,8 +327,17 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest,
>
>  	iter = dir_iterator_begin(src->buf, DIR_ITERATOR_PEDANTIC);
>
> -	if (!iter)
> +	if (!iter) {
> +		if (errno == ENOTDIR) {
> +			int saved_errno = errno;
> +			struct stat st;
> +			if (lstat(src->buf, &st) == 0 && S_ISLNK(st.st_mode))

I missed it on my first read, but you may want to consider "!lstat(...)"
instead of "lstat(...) == 0". Probably not worth a reroll, though.

Thanks,
Taylor

  parent reply	other threads:[~2023-04-11  1:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-04 23:48 [PATCH] clone: error specifically with --local and symlinked objects Glen Choo via GitGitGadget
2023-04-05  0:13 ` Junio C Hamano
2023-04-05 16:48   ` Glen Choo
2023-04-05 19:20     ` Junio C Hamano
2023-04-06 21:35     ` Taylor Blau
2023-04-06 21:55       ` Glen Choo
2023-04-06 21:27   ` Taylor Blau
2023-04-10 22:18 ` [PATCH v2] " Glen Choo via GitGitGadget
2023-04-10 22:27   ` Junio C Hamano
2023-04-10 23:16   ` Taylor Blau
2023-04-11  1:58   ` Taylor Blau [this message]
2023-04-11 17:08   ` [PATCH v3] " Glen Choo via GitGitGadget
2023-04-11 17:13     ` Junio C Hamano
2023-04-11 18:38       ` Glen Choo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZDS+zJAilFqxMSqa@nand.local \
    --to=me@ttaylorr.com \
    --cc=chooglen@google.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).