Abillity to clone git repository in non-empty folder [feature-request]
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 1.7k
- Forks
- 408
- Merge medio
- 2 d 57 min
- PR fusionados (30 d)
- 7
Descripción
When I try to clone a repository using the pygit2.clone_repository function, it keeps giving me a '.' exists and is not an empty directory error. I can solve this by appending a backward slash / to the pathstr. I, however, for my project, need to be able to clone multiple repositories next to each other inside a catkin workspace. There are several easy workarounds for this problem, but I wondered if this is supported out of the box. I think supporting this out of the box would be more in line with how the bash git client clones git repositories.
How to reproduce
- Run the following code in python.
import pygit2
repo_url = "https://bitbucket.org/theconstructcore/spawn_robot_tools.git"
pygit2.clone_repository(repo_url, ".", bare=True)
- See the not empty folder error.
Example work-around
import pygit2
repo_url = "https://bitbucket.org/theconstructcore/spawn_robot_tools.git"
pygit2.clone_repository(repo_url, "./"+repo_url.split("/")[-1].replace(".git", ""), bare=True)
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Empieza ejecutando la reproducción en Python para pygit2.clone_repository con "." y bare=True. Inspecciona pygit2/init.py alrededor de la definición de clone_repository en la línea 165; el cambio estará terminado cuando la clonación en la carpeta no vacía mostrada funcione sin el workaround y se conserve el comportamiento existente.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- git, python
- Área
- api
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100