private async Task CommitFileAsync(TFile file, string commitComment) { try { await GitRepository.CommitAsync(GitBranches.Master, file.RelativePath, commitComment, file.Author); } catch (Exception firstException) { string exMessage = $"Could not commit '{file.RelativePath}'."; try { UndoWriteFile(file); throw new Exception(exMessage, firstException); } catch (Exception secondException) { throw new Exception(exMessage.TrimEnd('.') + " or undo writes.", new AggregateException(firstException, secondException)); } } }
public void WhenICallCommitAsyncBranchRelativePathComment() { DummyClock.UtcNowFactory = () => new DateTime(2015, 1, 1, 1, 1, 1); _gitRepository.CommitAsync(_given.Git.Branch, _given.Git.RelativePath, _given.Git.Comment, _given.Git.Author).Wait(); }