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

Commit 30dd822

Browse files
Fixing errors caused by the changes to GitRemote
1 parent 9e7a370 commit 30dd822

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

src/GitHub.Api/Git/GitRemote.cs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public struct GitRemote
2222
private string user;
2323
private string host;
2424
private GitRemoteFunction function;
25+
private readonly string token;
2526

2627
public string Name
2728
{
@@ -43,7 +44,10 @@ public string User
4344
get { return user; }
4445
}
4546

46-
public string Token { get; }
47+
public string Token
48+
{
49+
get { return token; }
50+
}
4751

4852
public string Host
4953
{
@@ -61,11 +65,22 @@ public GitRemote(string name, string url, string login, string user, string toke
6165
this.url = url;
6266
this.login = login;
6367
this.user = user;
64-
Token = token;
68+
this.token = token;
6569
this.host = host;
6670
this.function = function;
6771
}
6872

73+
public GitRemote(string name, string url)
74+
{
75+
this.name = name;
76+
this.url = url;
77+
login = null;
78+
user = null;
79+
token = null;
80+
host = null;
81+
function = GitRemoteFunction.Unknown;
82+
}
83+
6984
public override string ToString()
7085
{
7186
var sb = new StringBuilder();

src/GitHub.Api/Git/Repository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ private static GitBranch GetRemoteGitBranch(ConfigBranch x)
473473

474474
private static GitRemote GetGitRemote(ConfigRemote configRemote)
475475
{
476-
return new GitRemote { Name = configRemote.Name, Url = configRemote.Url };
476+
return new GitRemote(configRemote.Name, configRemote.Url);
477477
}
478478

479479
private IRemoteConfigBranchDictionary RemoteConfigBranches => cacheContainer.BranchCache.RemoteConfigBranches;

src/GitHub.Api/OutputProcessors/RemoteListOutputProcessor.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,7 @@ private void ReturnRemote()
9999
currentUrl = currentUrl.Substring(user.Length + 1);
100100
}
101101

102-
RaiseOnEntry(new GitRemote
103-
{
104-
Name = currentName,
105-
Host = host,
106-
Url = currentUrl,
107-
User = user,
108-
Function = remoteFunction
109-
});
110-
102+
RaiseOnEntry(new GitRemote(currentName, currentUrl, null, user, null, host, remoteFunction));
111103
Reset();
112104
}
113105

0 commit comments

Comments
 (0)