diff options
author | Taylor Blau <me@ttaylorr.com> | 2022-10-07 00:44:44 +0300 |
---|---|---|
committer | Taylor Blau <me@ttaylorr.com> | 2022-10-07 00:44:44 +0300 |
commit | 58612f82b660e3378c73f0698d11b0f1fef741da (patch) | |
tree | a5b2b30e15db36ab7df7eb02785f3badd6c69f12 /builtin/clone.c | |
parent | 8a7bfa0fd3af2d39be1a808774005c78575908d1 (diff) | |
parent | 868154bb1c08a547afaf74ed8bafdf9bf55d1fd5 (diff) |
Sync with 2.35.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 194d50f75f3..21e1ce5ac83 100644 --- a/builtin/clone.c +++ b/builtin/clone.c @@ -316,13 +316,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); @@ -338,6 +336,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; |