diff --git a/Octokit/Models/Request/RepositoryRequest.cs b/Octokit/Models/Request/RepositoryRequest.cs index 2f751f62a0..03753b432e 100644 --- a/Octokit/Models/Request/RepositoryRequest.cs +++ b/Octokit/Models/Request/RepositoryRequest.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; @@ -57,7 +58,19 @@ internal string DebuggerDisplay { get { - return string.Format(CultureInfo.InvariantCulture, "Type: {0}, Sort: {1}, Direction: {2}", Type, Sort, Direction); + var propValues = new List(); + if (Type.HasValue) + propValues.Add(string.Format(CultureInfo.InvariantCulture, "Type: {0}", Type)); + if (Sort.HasValue) + propValues.Add(string.Format(CultureInfo.InvariantCulture, "Sort: {0}", Sort)); + if (Direction.HasValue) + propValues.Add(string.Format(CultureInfo.InvariantCulture, "Direction: {0}", Direction)); + if (Visibility.HasValue) + propValues.Add(string.Format(CultureInfo.InvariantCulture, "Visibility: {0}", Visibility)); + if (Affiliation.HasValue) + propValues.Add(string.Format(CultureInfo.InvariantCulture, "Affiliation: {0}", Affiliation)); + + return string.Join(", ", propValues); } } }