File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed
GitVersionCore/BuildServers Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -172,17 +172,12 @@ static IEnumerable<DirectReference> GetRemoteTipsForAnonymousUser(Repository rep
172172 static void CreateMissingLocalBranchesFromRemoteTrackingOnes ( Repository repo , string remoteName )
173173 {
174174 var prefix = string . Format ( "refs/remotes/{0}/" , remoteName ) ;
175+ var expectedRemoteHeadCanonicalName = string . Format ( "{0}{1}" , prefix , "HEAD" ) ;
175176
176- foreach ( var remoteTrackingReference in repo . Refs . FromGlob ( prefix + "*" ) )
177+ foreach ( var remoteTrackingReference in repo . Refs . FromGlob ( prefix + "*" ) . Where ( r => r . CanonicalName != expectedRemoteHeadCanonicalName ) )
177178 {
178179 var localCanonicalName = "refs/heads/" + remoteTrackingReference . CanonicalName . Substring ( prefix . Length ) ;
179180
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-
186181 if ( repo . Refs . Any ( x => x . CanonicalName == localCanonicalName ) )
187182 {
188183 Logger . WriteInfo ( string . Format ( "Skipping local branch creation since it already exists '{0}'." , remoteTrackingReference . CanonicalName ) ) ;
You can’t perform that action at this time.
0 commit comments