public async Task BranchUsingLocalGit(long buildId, string branchName) { VcsCommit commit = await GetCommitInformationByBuildId(buildId); if (commit == null) { Log.Info("Could not find commit for build. Skipping creation of branch step."); return; } IGitRepository gitRepository = _gitRepositoryFactory.Clone(commit); if (gitRepository == null) { throw new Exception("Unable to Clone Git Repository and create branch"); } if (gitRepository.AddBranch(branchName, commit.CommitSha)) { gitRepository.CheckoutBranch(branchName); gitRepository.Push(branchName); } gitRepository.DeleteFolder(); }
public IBuildConfigXml Read(string projectId, string buildConfigId) { _gitRepository.CheckoutBranch("master"); return(ReadBuildConfigXmlContents(projectId, buildConfigId)); }