summaryrefslogtreecommitdiff
path: root/builtin/clone.c
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2022-10-06 17:40:44 -0400
committerTaylor Blau <me@ttaylorr.com>2022-10-06 17:40:44 -0400
commit9cbd2827c5a19d935054cdb162e53e5703be09f4 (patch)
treef7850cda5827aacd30b18b9d9f6494d46d3dc4d6 /builtin/clone.c
parent067aa8fb41d09814d26f82515573b067feba87ba (diff)
parentecf9b4a443ecd2c7dc759e5d18f226694bc3eced (diff)
downloadgit-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.c8
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;