Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repository not being cloned inside a docker container #1735

Open
Hobaxo13 opened this issue Nov 7, 2019 · 0 comments
Open

Repository not being cloned inside a docker container #1735

Hobaxo13 opened this issue Nov 7, 2019 · 0 comments

Comments

@Hobaxo13
Copy link

Hobaxo13 commented Nov 7, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant