diff options
author | Taylor Blau <me@ttaylorr.com> | 2022-10-06 23:39:15 +0200 |
---|---|---|
committer | Taylor Blau <me@ttaylorr.com> | 2022-10-06 23:39:15 +0200 |
commit | 122512967e6184b1888a63ea2b6ed9ada3046b28 (patch) | |
tree | 91a2c08868d550b5ce21efd7176c4d2d634bc44f /builtin | |
parent | Git 2.31.4 (diff) | |
parent | Git 2.30.6 (diff) | |
download | git-122512967e6184b1888a63ea2b6ed9ada3046b28.tar.xz git-122512967e6184b1888a63ea2b6ed9ada3046b28.zip |
Sync with 2.30.6
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Diffstat (limited to 'builtin')
-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 51e844a2de..8c05d58f34 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -420,13 +420,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); @@ -442,6 +440,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; |