Skip to content

Commit

Permalink
ccnet#273 Support GitVersion
Browse files Browse the repository at this point in the history
- change git fetch command
  • Loading branch information
savornicesei committed Jan 20, 2020
1 parent 21eb3ca commit 5f523b8
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions project/core/sourcecontrol/Git.cs
Original file line number Diff line number Diff line change
Expand Up @@ -454,13 +454,18 @@ private RepositoryAction CreateUpateLocalRepository(IIntegrationResult result)
/// <summary>
/// Setup the local repository with some required config settings.
///
/// Always:
/// -
/// For tagging:
/// - User name
/// - User e-mail
/// </summary>
/// <param name="result">IIntegrationResult of the current build.</param>
private void SetupLocalRepository(IIntegrationResult result)
{

GitConfigSet("remote.origin.url", Repository, result);

if (!string.IsNullOrEmpty(CommitterName) && !string.IsNullOrEmpty(CommitterEMail))
{
GitConfigSet("user.name", CommitterName, result);
Expand Down Expand Up @@ -617,10 +622,14 @@ private void GitFetch(IIntegrationResult result)
{
ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
buffer.AddArgument("fetch");
buffer.AddArgument("origin");

// initialize progress information
var bpi = GetBuildProgressInformation(result);
buffer.AddArgument("--tags");
buffer.AddArgument("--force");
buffer.AddArgument("--progress");
buffer.AddArgument("origin");
buffer.AddArgument("+refs/heads/*:refs/remotes/origin/*");

// initialize progress information
var bpi = GetBuildProgressInformation(result);
bpi.SignalStartRunTask(string.Concat("git ", buffer.ToString()));

// enable Stdout monitoring
Expand All @@ -632,12 +641,12 @@ private void GitFetch(IIntegrationResult result)
ProcessExecutor.ProcessOutput -= ProcessExecutor_ProcessOutput;
}

/// <summary>
/// Checkout a remote branch with the "git checkout -q -f 'origin/branchName'" command.
/// </summary>
/// <param name="branchName">Name of the branch to checkout.</param>
/// <param name="result">IIntegrationResult of the current build.</param>
private void GitCheckoutRemoteBranch(string branchName, IIntegrationResult result)
/// <summary>
/// Checkout a remote branch with the "git checkout -q -f 'origin/branchName'" command.
/// </summary>
/// <param name="branchName">Name of the branch to checkout.</param>
/// <param name="result">IIntegrationResult of the current build.</param>
private void GitCheckoutRemoteBranch(string branchName, IIntegrationResult result)
{
ProcessArgumentBuilder buffer = new ProcessArgumentBuilder();
buffer.AddArgument("checkout");
Expand Down

0 comments on commit 5f523b8

Please sign in to comment.