[Test] public void Create_Repo_Add_Files_Check_Head() { var nGit = new API_NGit(); var tempRepo = "_tempRepo".tempDir(true); "TestRepo is: {0}".info(tempRepo); //Creating a local temp Repo Assert.IsFalse(tempRepo.isGitRepository(), "Should not be a repo"); nGit.init(tempRepo); Assert.IsTrue(tempRepo.isGitRepository(), "Should be a repo"); Assert.IsNull(nGit.head()); //Adding a file (using method 1) nGit.file_Create("testFile.txt", "some Text"); nGit.add_and_Commit_using_Status(); var head1 = nGit.head(); Assert.IsNotNull(head1); //Adding another file (using method 2) nGit.file_Create("testFile2.txt", "some Text"); nGit.add("testFile2.txt"); nGit.commit("Adding Another file"); //making sure the head has changed var head2 = nGit.head(); Assert.AreNotEqual(head1, head2); nGit.delete_Repository_And_Files(); }
public static RevCommit add_and_Commit_Random_File(this API_NGit nGit) { var randomFile = nGit.file_Create_Random_File(); nGit.add(randomFile); var commitMessage = "Adding random file: {0}".format(randomFile); return(nGit.commit(commitMessage)); }
public static API_NGit add(this API_NGit nGit) { return(nGit.add(".")); }
public static RevCommit add_and_Commit_using_Status(this API_NGit nGit) { nGit.add(); return(nGit.commit_using_Status()); }
public static API_NGit add(this API_NGit nGit, string filePattern) { return(nGit.add(filePattern, true)); }