@@ -40,7 +40,7 @@ public static void NormalizeGitDirectory(string gitDirectory, AuthenticationInfo
4040 Fetch ( authentication , remote , repo ) ;
4141 }
4242
43- EnsureLocalBranchExistsForCurrentBranch ( repo , currentBranch ) ;
43+ EnsureLocalBranchExistsForCurrentBranch ( repo , remote , currentBranch ) ;
4444 CreateOrUpdateLocalBranchesFromRemoteTrackingOnes ( repo , remote . Name ) ;
4545
4646 var headSha = repo . Refs . Head . TargetIdentifier ;
@@ -132,7 +132,7 @@ public static void Fetch(AuthenticationInfo authentication, Remote remote, Repos
132132 Commands . Fetch ( repo , remote . Name , new string [ 0 ] , authentication . ToFetchOptions ( ) , null ) ;
133133 }
134134
135- static void EnsureLocalBranchExistsForCurrentBranch ( Repository repo , string currentBranch )
135+ static void EnsureLocalBranchExistsForCurrentBranch ( Repository repo , Remote remote , string currentBranch )
136136 {
137137 if ( string . IsNullOrEmpty ( currentBranch ) ) return ;
138138
@@ -143,7 +143,7 @@ static void EnsureLocalBranchExistsForCurrentBranch(Repository repo, string curr
143143 var repoTip = repo . Head . Tip ;
144144
145145 // We currently have the rep.Head of the *default* branch, now we need to look up the right one
146- var originCanonicalName = string . Format ( "origin/ {0}" , currentBranch ) ;
146+ var originCanonicalName = string . Format ( "{0}/{1}" , remote . Name , currentBranch ) ;
147147 var originBranch = repo . Branches [ originCanonicalName ] ;
148148 if ( originBranch != null )
149149 {
0 commit comments