Esempio n. 1
0
        private static void Populate_File_For_Commit(TestCommit commit, Repository repo)
        {
            var content  = string.Join("\n", commit.Lines);
            var filePath = Path.Combine(repo.Info.WorkingDirectory, commit.FileName);

            File.WriteAllText(filePath, content);
        }
Esempio n. 2
0
        private static void Commit_File(Repository repo, TestCommit commit)
        {
            Commands.Stage(repo, "*");

            var author = new Signature(commit.Name, commit.Email, commit.TimeStamp);

            repo.Commit(commit.CommitMessage, author, author);
        }
Esempio n. 3
0
 public RepositoryTestDataBuilder Make_Commit(TestCommit commit)
 {
     _commits.Add(new TestCommitWithBranch
     {
         Commit = commit,
         Branch = _branch
     });
     return(this);
 }
Esempio n. 4
0
        public TestCommit Build()
        {
            var result = new TestCommit
            {
                Name          = _authorName,
                Email         = _email,
                FileName      = _fileName,
                Lines         = new List <string>(),
                CommitMessage = _commitMessage,
                TimeStamp     = _commitTimestamp
            };

            result.Lines.AddRange(_fileContents);

            _fileContents.Clear();

            return(result);
        }