### Summary

When a path in a collection is a symlink to a directory, the symlink is replaced with an empty dir instead of either a copy of the symlink target or the original symlink.

collection source:
```
$ tree -Ap --noreport ~/my_namespace/testcollection/collection/roles/php/templates/etc/php
[drwxr-xr-x]  roles/php/templates/etc/php
├── [drwxr-xr-x]  7.3
│   └── [drwxr-xr-x]  fpm
│       └── [drwxr-xr-x]  pool.d
│           └── [-rw-r--r--]  www.conf.j2
└── [lrwxrwxrwx]  7.4 -> 7.3
```

collection after installation (from git source):
```
$ tree -Ap --noreport ~/.ansible/collections/ansible_collections/my_namespace/testcollection/roles/php/templates/etc/php
[drwxr-xr-x]  roles/php/templates/etc/php
├── [drwxr-xr-x]  7.3
│   └── [drwxr-xr-x]  fpm
│       └── [drwxr-xr-x]  pool.d
│           └── [-rw-r--r--]  www.conf.j2
└── [drwxr-xr-x]  7.4
```

role `meta/requirements.yml` contains the following:
```
collections:
  - name: my_namespace.testcollection
    source: git+file:///home/twouters/my_namespace/testcollection#/collection/
    version: 2022.31.0-coll5
    type: git
```

contents of collection tar.gz after `ansible-galaxy collection build` seems to still be correct:
```
$ tar -tvf my_namespace-testcollection-2022.31.0-coll5.tar.gz | grep -F roles/php/templates
drwxr-xr-x 0/0               0 2022-08-03 11:31 roles/php/templates/etc/php/
lrw-r--r-- 0/0               0 1970-01-01 01:00 roles/php/templates/etc/php/7.4 -> 7.3
drwxr-xr-x 0/0               0 2022-08-03 11:31 roles/php/templates/etc/php/7.3/
drwxr-xr-x 0/0               0 2022-08-03 11:31 roles/php/templates/etc/php/7.3/fpm/
drwxr-xr-x 0/0               0 2022-08-03 11:31 roles/php/templates/etc/php/7.3/fpm/pool.d/
-rw-r--r-- 0/0             430 2022-08-03 11:31 roles/php/templates/etc/php/7.3/fpm/pool.d/www.conf.j2
```

installation from tar.gz with `ansible-galaxy collection install --force my_namespace-testcollection-2022.31.0-coll5.tar.gz` is fine:
```
$ tree -Ap --noreport ~/.ansible/collections/ansible_collections/my_namespace/testcollection/roles/php/templates/etc/php
[drwxr-xr-x]  roles/php/templates/etc/php
├── [drwxr-xr-x]  7.3
│   └── [drwxr-xr-x]  fpm
│       └── [drwxr-xr-x]  pool.d
│           └── [-rw-r--r--]  www.conf.j2
└── [lrwxrwxrwx]  7.4 -> 7.3
```

### Issue Type

Bug Report

### Component Name

ansible-galaxy

### Ansible Version

```console
$ ansible --version
ansible [core 2.13.2]
  config file = /home/twouters/.ansible.cfg
  configured module search path = ['/home/twouters/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.10/site-packages/ansible
  ansible collection location = /home/twouters/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.5 (main, Aug  1 2022, 07:53:20) [GCC 12.1.0]
  jinja version = 3.1.2
  libyaml = True
```


### Configuration

```console
# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all
$
```


### OS / Environment

Arch Linux

### Steps to Reproduce

See summary

### Expected Results

See summary. I expect to either have a copy of the symlink target or preferably the original symlink.

### Actual Results

```console
See summary
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct
path = to_text(full_path[len(b_collection_path) + 1::], errors='surrogate_or_strict')
            if full_path not in collection_files:
                modified_content.append(
                    ModifiedContent(filename=path, expected='the file does not exist', installed='the file exists')
                )
        for name in dirs:
            full_path = os.path.join(root, name)
            path = to_text(full_path[len(b_collection_path) + 1::], errors='surrogate_or_strict')
            if full_path not in collection_dirs:
                modified_content.append(
                    ModifiedContent(filename=path, expected='the directory does not exist', installed='the directory exists')
                )
    if modified_content:
        result.success = False
        display.display(
            'Collection {fqcn!s} contains modified content '
            'in the following files:'.
            format(fqcn=to_text(local_collection.fqcn)),
        )
        for content_change in modified_content:
            display.display('    %s' % content_change.filename)
            display.v("    Expected: %s\n    Found: %s" % (content_change.expected, content_change.installed))
    else:
        what = "are internally consistent with its manifest" if verify_local_only else "match the remote collection"
        display.display(
            "Successfully verified that checksums for '{coll!s}' {what!s}.".
            format(coll=local_collection, what=what),
        )
    return result
def verify_file_signatures(fqcn, manifest_file, detached_signatures, keyring, required_successful_count, ignore_signature_errors):