-
Notifications
You must be signed in to change notification settings - Fork 909
Open
Description
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);
}
}
`
komarovalexander
Metadata
Metadata
Assignees
Labels
No labels