diff options
author | Taylor Blau <me@ttaylorr.com> | 2022-10-06 17:40:44 -0400 |
---|---|---|
committer | Taylor Blau <me@ttaylorr.com> | 2022-10-06 17:40:44 -0400 |
commit | 9cbd2827c5a19d935054cdb162e53e5703be09f4 (patch) | |
tree | f7850cda5827aacd30b18b9d9f6494d46d3dc4d6 /builtin/clone.c | |
parent | 067aa8fb41d09814d26f82515573b067feba87ba (diff) | |
parent | ecf9b4a443ecd2c7dc759e5d18f226694bc3eced (diff) | |
download | git-9cbd2827c5a19d935054cdb162e53e5703be09f4.tar.gz |
Sync with 2.31.5
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Diffstat (limited to 'builtin/clone.c')
-rw-r--r-- | builtin/clone.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/builtin/clone.c b/builtin/clone.c index eeb74c0217..cdf9208d45 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -424,13 +424,11 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest, int src_len, dest_len; struct dir_iterator *iter; int iter_status; - unsigned int flags; struct strbuf realpath = STRBUF_INIT; mkdir_if_missing(dest->buf, 0777); - flags = DIR_ITERATOR_PEDANTIC | DIR_ITERATOR_FOLLOW_SYMLINKS; - iter = dir_iterator_begin(src->buf, flags); + iter = dir_iterator_begin(src->buf, DIR_ITERATOR_PEDANTIC); if (!iter) die_errno(_("failed to start iterator over '%s'"), src->buf); @@ -446,6 +444,10 @@ static void copy_or_link_directory(struct strbuf *src, struct strbuf *dest, strbuf_setlen(dest, dest_len); strbuf_addstr(dest, iter->relative_path); + if (S_ISLNK(iter->st.st_mode)) + die(_("symlink '%s' exists, refusing to clone with --local"), + iter->relative_path); + if (S_ISDIR(iter->st.st_mode)) { mkdir_if_missing(dest->buf, 0777); continue; |