diff --git a/project/core/sourcecontrol/Git.cs b/project/core/sourcecontrol/Git.cs index c07f0ead0..083101d07 100644 --- a/project/core/sourcecontrol/Git.cs +++ b/project/core/sourcecontrol/Git.cs @@ -454,6 +454,8 @@ private RepositoryAction CreateUpateLocalRepository(IIntegrationResult result) /// /// Setup the local repository with some required config settings. /// + /// Always: + /// - /// For tagging: /// - User name /// - User e-mail @@ -461,6 +463,9 @@ private RepositoryAction CreateUpateLocalRepository(IIntegrationResult result) /// IIntegrationResult of the current build. private void SetupLocalRepository(IIntegrationResult result) { + + GitConfigSet("remote.origin.url", Repository, result); + if (!string.IsNullOrEmpty(CommitterName) && !string.IsNullOrEmpty(CommitterEMail)) { GitConfigSet("user.name", CommitterName, result); @@ -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 @@ -632,12 +641,12 @@ private void GitFetch(IIntegrationResult result) ProcessExecutor.ProcessOutput -= ProcessExecutor_ProcessOutput; } - /// - /// Checkout a remote branch with the "git checkout -q -f 'origin/branchName'" command. - /// - /// Name of the branch to checkout. - /// IIntegrationResult of the current build. - private void GitCheckoutRemoteBranch(string branchName, IIntegrationResult result) + /// + /// Checkout a remote branch with the "git checkout -q -f 'origin/branchName'" command. + /// + /// Name of the branch to checkout. + /// IIntegrationResult of the current build. + private void GitCheckoutRemoteBranch(string branchName, IIntegrationResult result) { ProcessArgumentBuilder buffer = new ProcessArgumentBuilder(); buffer.AddArgument("checkout");