@@ -40,7 +40,7 @@ public static void NormalizeGitDirectory(string gitDirectory, AuthenticationInfo
40
40
Fetch ( authentication , remote , repo ) ;
41
41
}
42
42
43
- EnsureLocalBranchExistsForCurrentBranch ( repo , currentBranch ) ;
43
+ EnsureLocalBranchExistsForCurrentBranch ( repo , remote , currentBranch ) ;
44
44
CreateOrUpdateLocalBranchesFromRemoteTrackingOnes ( repo , remote . Name ) ;
45
45
46
46
var headSha = repo . Refs . Head . TargetIdentifier ;
@@ -132,7 +132,7 @@ public static void Fetch(AuthenticationInfo authentication, Remote remote, Repos
132
132
Commands . Fetch ( repo , remote . Name , new string [ 0 ] , authentication . ToFetchOptions ( ) , null ) ;
133
133
}
134
134
135
- static void EnsureLocalBranchExistsForCurrentBranch ( Repository repo , string currentBranch )
135
+ static void EnsureLocalBranchExistsForCurrentBranch ( Repository repo , Remote remote , string currentBranch )
136
136
{
137
137
if ( string . IsNullOrEmpty ( currentBranch ) ) return ;
138
138
@@ -143,7 +143,7 @@ static void EnsureLocalBranchExistsForCurrentBranch(Repository repo, string curr
143
143
var repoTip = repo . Head . Tip ;
144
144
145
145
// 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 ) ;
147
147
var originBranch = repo . Branches [ originCanonicalName ] ;
148
148
if ( originBranch != null )
149
149
{
0 commit comments