Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit f91d092

Browse files
Correctly setting the remote tracking branch
1 parent ff753f3 commit f91d092

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/GitHub.Api/Git/Repository.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ private void RepositoryManagerOnCurrentBranchUpdated(ConfigBranch? branch, Confi
247247
{
248248
var data = new RepositoryInfoCacheData();
249249
data.CurrentConfigBranch = branch;
250-
data.CurrentGitBranch = branch.HasValue ? (GitBranch?)GetLocalGitBranch(branch.Value.name, branch.Value) : null;
250+
data.CurrentGitBranch = branch.HasValue ? (GitBranch?)GetLocalGitBranch(branch.Value) : null;
251251
data.CurrentConfigRemote = remote;
252252
data.CurrentGitRemote = remote.HasValue ? (GitRemote?)GetGitRemote(remote.Value) : null;
253253
data.CurrentHead = head;
@@ -303,15 +303,15 @@ private void RepositoryManagerOnRemoteBranchesUpdated(Dictionary<string, ConfigR
303303
private void RepositoryManagerOnLocalBranchesUpdated(Dictionary<string, ConfigBranch> localConfigBranchDictionary)
304304
{
305305
taskManager.RunInUI(() => {
306-
var gitLocalBranches = localConfigBranchDictionary.Values.Select(x => GetLocalGitBranch(CurrentBranchName, x)).ToArray();
306+
var gitLocalBranches = localConfigBranchDictionary.Values.Select(x => GetLocalGitBranch(x)).ToArray();
307307
cacheContainer.BranchCache.SetLocals(localConfigBranchDictionary, gitLocalBranches);
308308
});
309309
}
310310

311-
private static GitBranch GetLocalGitBranch(string currentBranchName, ConfigBranch x)
311+
private static GitBranch GetLocalGitBranch(ConfigBranch x)
312312
{
313313
var branchName = x.Name;
314-
var trackingName = x.IsTracking ? x.Remote.Value.Name + "/" + branchName : "[None]";
314+
var trackingName = x.IsTracking ? x.Remote.Value.Name + "/" + branchName : null;
315315
return new GitBranch(branchName, trackingName);
316316
}
317317

0 commit comments

Comments
 (0)