libgit2sharp icon indicating copy to clipboard operation
libgit2sharp copied to clipboard

pushing throws error when using refs

Open bigpod98 opened this issue 5 years ago • 0 comments

pushing via remote and refs throws No error message has been provided by the native library

Code example repo.Network.Push(remote, refs, pushOptions);

this happens in prerelease(0.27.0 preview 096) but not in 0.26.2 but i cannot use that since 0.26.2 doesnt work on linux

FULL CODE EXAMPLE:

var remote = repo.Network.Remotes.Add("pushRepo", TargetRepo, "+refs/*:refs/*");
                repo.Config.Set("remote.pushRepo.mirror", true);

                var pushOptions = new PushOptions
                {
                    CredentialsProvider = (url, fromUrl, types) =>
                        new UsernamePasswordCredentials()
                        {
                            Username = "username",
                            Password = "password"
                        }
                };

                var refs = repo.Refs.Select(r => r.CanonicalName);
                repo.Network.Push(remote, refs, pushOptions);

bigpod98 avatar Jan 26 '21 22:01 bigpod98