libgit2 / libgit2/libgit2sharp
Repositories with git-dir and work-dir should't create .git file in working directory
まだ誰も着手していません。
- 主要言語
- C#
- スター
- 3.5k
- フォーク
- 925
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Reproduction steps
Repository.Init("/working/path", "/git/path");
Expected behavior
For most cases the whole point of doing this separation of working directory and git directory is to avoid the existence of .git file/folder in working directory
Actual behavior
The repo_is_worktree in repository.c of libgit2, should not checking for gitdir in working directory.
In config file, in git directory there is a field worktree = /working/path which could be used to find out which is the working directory.
My suggestion would be, in private Repository constructor to get the worktree value from config file in git-directory and pass it to the Proxy.git_repository_set_workdir in Repository class
instead of reading the value from options that were given from caller.
Future improvement would be not event passing the working directory, because it can be extracted from config file.
Hope to hear soon your opinion on this
Max
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
Repository.Init と非公開の Repository コンストラクターから始め、次に Proxy.git_repository_set_workdir の周辺にある Repository.cs を調べます。そのパスを、src/repository.c の repo_is_worktree と gitdir の処理と比較し、説明されているとおり Git ディレクトリ設定の worktree 値を使用します。作業パスと Git パスを分けて問題を再現し、初期化によって作業ディレクトリに .git ファイルが作成されなくなったことを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- csharp, git
- 領域
- tooling
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100