10000 Fix null reference when no remote branch by jcansdale · Pull Request #1273 · github/VisualStudio · GitHub
[go: up one dir, main page]

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

Fix null reference when no remote branch #1273

Merged
merged 2 commits into from
Oct 19, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/GitHub.Exports/Models/BranchModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ public BranchModel(LibGit2Sharp.Branch branch, IRepositoryModel repo)
Extensions.Guard.ArgumentNotNull(repo, nameof(repo));
Name = DisplayName = branch.FriendlyName;
#pragma warning disable 0618 // TODO: Replace `Branch.Remote` with `Repository.Network.Remotes[branch.RemoteName]`.
var remoteUrl = branch.Remote.Url;
Repository = branch.IsRemote ? new LocalRepositoryModel(branch.Remote.Url) : repo;
#pragma warning restore 0618
Repository = branch.IsRemote ? new LocalRepositoryModel(remoteUrl) : repo;
IsTracking = branch.IsTracking;
Id = String.Format(CultureInfo.InvariantCulture, "{0}/{1}", Repository.Owner, Name);
}
Expand Down
0