libgit2 / libgit2/libgit2sharp

Repository not being cloned inside a docker container

オープン
#1,735 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
C#
スター
3.5k
フォーク
925
PR マージ指標
30日以内にマージされた PR はありません

説明

Reproduction steps

I currently am deploying a micro-service using .net standard 2.0, which either clones or updates a repo from GitLab.

For this I have a functionality that works perfectly in a Windows environment, but it does not do the trick inside a docker container after I spin it up.

Expected behavior

The repo should be cloned/pulled in a Docker container just like in Windows.

Actual behavior

No repo structure is present inside the linux directory (permissions set to 777). I am also seeing the directory's timestamp being updated when it should do the pull.

Version of LibGit2Sharp (release number or SHA1)
**netstandard2.0**
Operating system(s) tested; .NET runtime tested

Working:
Windows 10 Enterprise, 64-bit
Not working:
Linux 828ec2e85f2c 4.9.184-linuxkit #1 SMP Tue Jul 2 22:58:16 UTC 2019 x86_64 GNU/Linux

Implementation
if (gitFolder.GetDirectories().Length == 0)
{
    try
    {
        // Get user credentials
        Repository.Clone("repository.git", deployerPath, new CloneOptions()
        {
            BranchName = "develop",
            CredentialsProvider = CredentialsProvider(),
        });
    }
    catch (Exception ex)
    {
        ...
    }
}
else
{
    try
    {
        var repository = new Repository(deployerPath);
        Commands.Pull(repository,
            new Signature("blah", "blah@blah.com", DateTimeOffset.Now), new PullOptions()
            {
                FetchOptions = new FetchOptions() {CredentialsProvider = CredentialsProvider()},
                MergeOptions = new MergeOptions() {FailOnConflict = true},
            });
    }
    ...

I raised this question in SO (find it here); however, I have not received a response back.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

報告されたエントリーポイントは、示されている C# 実装の Repository.Clone と Commands.Pull です。まず、記載された Linux Docker 環境で LibGit2Sharp 0.26.1 を使用して動作を再現し、例外またはステータス出力を取得してください。リポジトリが存在しない理由を特定し、検証済みのコンテナ互換の修正を文書化または実装できれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
csharp, docker, gitlab
領域
devops
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。