Abillity to clone git repository in non-empty folder [feature-request]
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 1.7k
- フォーク
- 408
- 平均マージ
- 2日 57分
- マージ済み PR(30日)
- 7
説明
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)
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、"." と bare=True を指定して pygit2.clone_repository の Python 再現を実行します。165 行目の clone_repository の定義付近にある pygit2/init.py を調べます。変更の完了条件は、既存の動作を維持したまま、示されている空でないフォルダーへのクローンが workaround なしで機能することです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- git, python
- 領域
- api
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100