Repository: cookiecutter/cookiecutter

Issue:
pre_prompt bug when generating from current folder
* Cookiecutter version: 2.4.0
* Template project url: N/A
* Python version: 3.10
* Operating System: Linux

### Description:

I just learned about the new pre_prompt in 2.4.0. It's exactly what I wanted. Thanks for the new feature. When I develop the templates sometimes I will just run the cookiecutter in the same directory: `cookiecutter .`. With pre_prompt defined it will crash with an error saying the temporary directory already exists:
```
Traceback (most recent call last):
  File "/envs/cookiecutter/bin/cookiecutter", line 10, in <module>
    sys.exit(main())
  File "/envs/cookiecutter/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/envs/cookiecutter/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/envs/cookiecutter/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/envs/cookiecutter/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/envs/cookiecutter/lib/python3.10/site-packages/cookiecutter/cli.py", line 202, in main
    cookiecutter(
  File "/envs/cookiecutter/lib/python3.10/site-packages/cookiecutter/main.py", line 91, in cookiecutter
    repo_dir = run_pre_prompt_hook(base_repo_dir) if accept_hooks else repo_dir
  File "/envs/cookiecutter/lib/python3.10/site-packages/cookiecutter/hooks.py", line 179, in run_pre_prompt_hook
    repo_dir = create_tmp_repo_dir(repo_dir)
  File "/envs/cookiecutter/lib/python3.10/site-packages/cookiecutter/utils.py", line 128, in create_tmp_repo_dir
    shutil.copytree(repo_dir, new_dir)
  File "/envs/cookiecutter/lib/python3.10/shutil.py", line 559, in copytree
    return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
  File "/envs/cookiecutter/lib/python3.10/shutil.py", line 457, in _copytree
    os.makedirs(dst, exist_ok=dirs_exist_ok)
  File "/envs/cookiecutter/lib/python3.10/os.py", line 225, in makedirs
    mkdir(name, mode)
FileExistsError: [Errno 17] File exists: '/tmp/cookiecutter7yw9w4f5/'
```

It seems the temporary sub-directory name depends on the directory name of the repository, "." probably resolves to nothing and it will try to create the parent directory instead, so if I use the absolute path of the current directory it works: `cookiecutter $(pwd)`. It feels like a possible fix is just to compute the absolute path of the input path first. Thanks.



Discussion:

Resolving patch:
diff --git a/cookiecutter/utils.py b/cookiecutter/utils.py
--- a/cookiecutter/utils.py
+++ b/cookiecutter/utils.py
@@ -121,7 +121,7 @@ def __init__(self, environment):
 
 def create_tmp_repo_dir(repo_dir: "os.PathLike[str]") -> Path:
     """Create a temporary dir with a copy of the contents of repo_dir."""
-    repo_dir = Path(repo_dir) if isinstance(repo_dir, str) else repo_dir
+    repo_dir = Path(repo_dir).resolve()
     base_dir = tempfile.mkdtemp(prefix='cookiecutter')
     new_dir = f"{base_dir}/{repo_dir.name}"
     logger.debug(f'Copying repo_dir from {repo_dir} to {new_dir}')


Test patch: