Thanks to visit codestin.com
Credit goes to github.com

Skip to content

"Too many redirects or authentication replays" when pushing changes #1419

@366Cobra

Description

@366Cobra

Hi,

have been search for this for a day and some people mentioned it is a bug.
I can clone, stage and commit, but the push always fails.
Command line push works fine

ClonedRepoPath = @"c:\temp\test"
_params.ClonedRepoPath = "http://172.16.40.129/test/Interfaces.git"

clone:
` if (!Directory.Exists(_params.ClonedRepoPath))
{
Directory.CreateDirectory(_params.ClonedRepoPath);
}

        var result = Repository.Clone(_params.ServerPath, _params.ClonedRepoPath);

`

stage, commit and push
`
using (var repo = new Repository(_params.ClonedRepoPath))
{
if (repo.Network.Remotes.All(r => r.Name != name))
{
repo.Network.Remotes.Add(name, _params.ServerPath);
}

           Commands.Stage(repo, "*");

           if (repo.RetrieveStatus().IsDirty)
           {
              Commit commit = repo.Commit("CodeGen commit", new Signature(_params.UserName, _params.EmailAddress, System.DateTimeOffset.Now)
                                                          , new Signature(_params.UserName, _params.EmailAddress, System.DateTimeOffset.Now));

              var options = new PushOptions{
                                              CredentialsProvider = (_url, _user, _cred) => new DefaultCredentials()
                                           };

              repo.Network.Push(repo.Network.Remotes["origin"], @"refs/heads/master", options);
           }
        }

`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions