Skip to content

Commit e822e7b

Browse files
author
Gary Ewan Park
committed
(#284) Skip creation of HEAD branch
- Based on a suggestion from @nulltoken, skipping the creation of the HEAD branch, if it exists in the list of branches to create. - This was causing an issue when running on AppVeyor - This can be seen working here: https://ci.appveyor.com/project/GaryEwanPark/webapisample/build/0.2.0-unstable.23+23%20(Build%2034)
1 parent 332480f commit e822e7b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

GitVersionCore/BuildServers/GitHelper.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,13 @@ static void CreateMissingLocalBranchesFromRemoteTrackingOnes(Repository repo, st
176176
foreach (var remoteTrackingReference in repo.Refs.FromGlob(prefix + "*"))
177177
{
178178
var localCanonicalName = "refs/heads/" + remoteTrackingReference.CanonicalName.Substring(prefix.Length);
179+
180+
if (localCanonicalName.EndsWith("HEAD"))
181+
{
182+
Logger.WriteInfo(string.Format("Skipping creation of '{0}' as this is not required.", remoteTrackingReference.CanonicalName));
183+
continue;
184+
}
185+
179186
if (repo.Refs.Any(x => x.CanonicalName == localCanonicalName))
180187
{
181188
Logger.WriteInfo(string.Format("Skipping local branch creation since it already exists '{0}'.", remoteTrackingReference.CanonicalName));

0 commit comments

Comments
 (0)