libgit2 / libgit2/libgit2sharp

Repository not being cloned inside a docker container

未關閉
#1,735 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
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. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

回報的進入點是所示 C# 實作中的 Repository.Clone 和 Commands.Pull;首先在列出的 Linux Docker 環境中使用 LibGit2Sharp 0.26.1 重現該行為,並擷取例外或狀態輸出。完成的標準是找出 repository 缺失的原因,並記錄或實作一個經過驗證且相容於容器的修正方案。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
csharp, docker, gitlab
領域
devops
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。