Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Commit 43121d6

Browse files
Don't hardcode 'origin' as remote but use remote.Name
1 parent 98e7127 commit 43121d6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/GitTools.Core/GitTools.Core.Shared/Git/Helpers/GitRepositoryHelper.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)