File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
GitVersionCore/BuildServers Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -172,10 +172,12 @@ static IEnumerable<DirectReference> GetRemoteTipsForAnonymousUser(Repository rep
172
172
static void CreateMissingLocalBranchesFromRemoteTrackingOnes ( Repository repo , string remoteName )
173
173
{
174
174
var prefix = string . Format ( "refs/remotes/{0}/" , remoteName ) ;
175
+ var remoteHeadCanonicalName = string . Format ( "{0}{1}" , prefix , "HEAD" ) ;
175
176
176
- foreach ( var remoteTrackingReference in repo . Refs . FromGlob ( prefix + "*" ) )
177
+ foreach ( var remoteTrackingReference in repo . Refs . FromGlob ( prefix + "*" ) . Where ( r => r . CanonicalName != remoteHeadCanonicalName ) )
177
178
{
178
179
var localCanonicalName = "refs/heads/" + remoteTrackingReference . CanonicalName . Substring ( prefix . Length ) ;
180
+
179
181
if ( repo . Refs . Any ( x => x . CanonicalName == localCanonicalName ) )
180
182
{
181
183
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