private void Commit(GitBranches branch, string relativePath, string comment, Author author) { LogTo.Trace("Commit(branch: {0}, relativePath: {1}, comment: {2}, author: {3})", branch, relativePath, comment, author); try { using (var repo = new Repository(WorkingDirectory.FullName)) { repo.Checkout(branch.Name()); repo.Stage(relativePath); repo.Commit(comment, author.ToGitSignature(), Committer()); } } catch (EmptyCommitException) { // We can ignore this exception because there was nothing new to commit. // This can occur if the user uploads the same file. } }
public Task PushAsync(GitBranches branch) { LogTo.Trace("PushAsync(branch: {0})", branch); return(Task.Run(() => Push(branch.Name()))); }