From 2652b5e25251e6b4e0357100ffb7b776663c621b Mon Sep 17 00:00:00 2001 From: Geert van Horrik Date: Mon, 27 Feb 2017 18:57:03 +0100 Subject: [PATCH 1/2] When a specific branch is specified in GitRepositoryHelper, it should not checkout the *default branch* of the repository with the specified branch name, but it should checkout the actual remote branch --- .../Git/Helpers/GitRepositoryHelper.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/GitTools.Core/GitTools.Core.Shared/Git/Helpers/GitRepositoryHelper.cs b/src/GitTools.Core/GitTools.Core.Shared/Git/Helpers/GitRepositoryHelper.cs index 43d7b39..d9d6b24 100644 --- a/src/GitTools.Core/GitTools.Core.Shared/Git/Helpers/GitRepositoryHelper.cs +++ b/src/GitTools.Core/GitTools.Core.Shared/Git/Helpers/GitRepositoryHelper.cs @@ -139,7 +139,17 @@ static void EnsureLocalBranchExistsForCurrentBranch(Repository repo, string curr var isRef = currentBranch.Contains("refs"); var isBranch = currentBranch.Contains("refs/heads"); var localCanonicalName = !isRef ? "refs/heads/" + currentBranch : isBranch ? currentBranch : currentBranch.Replace("refs/", "refs/heads/"); + var repoTip = repo.Head.Tip; + + // We currently have the rep.Head of the *default* branch, now we need to look up the right one + var originCanonicalName = string.Format("origin/{0}", currentBranch); + var originBranch = repo.Branches[originCanonicalName]; + if (originBranch != null) + { + repoTip = originBranch.Tip; + } + var repoTipId = repoTip.Id; if (repo.Branches.All(b => b.CanonicalName != localCanonicalName)) From b15f5a65af0077ae1c3f9493c9a4146484031d49 Mon Sep 17 00:00:00 2001 From: Geert van Horrik Date: Tue, 28 Feb 2017 09:07:29 +0100 Subject: [PATCH 2/2] Don't use prerelease of GitLink yet --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 9cfcd2f..4dc2c7c 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,6 @@ install: - choco install gitversion.portable -pre -y - - cinst gitlink -pre -y + - cinst gitlink -y platform: - Any CPU