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

Commit bc07cbf

Browse files
Correctly returning null when the value is default
Consumers of this struct should not have to check for default values, as they can use the nullable value
1 parent 004acd1 commit bc07cbf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/GitHub.Api/Git/GitConfig.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ public ConfigBranch(string name, ConfigRemote? remote)
5050
this.remote = remote ?? ConfigRemote.Default;
5151
}
5252

53-
public bool IsTracking => !remote.Equals(ConfigRemote.Default);
53+
public bool IsTracking => Remote.HasValue;
5454

5555
public string Name => name;
5656

57-
public ConfigRemote? Remote => remote;
57+
public ConfigRemote? Remote => Equals(remote, ConfigRemote.Default) ? (ConfigRemote?) null : remote;
5858

5959
public override string ToString()
6060
{

0 commit comments

Comments
 (0)