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

Commit 28399be

Browse files
committed
Generate url with only startLine if endLine is the same
1 parent 9cf750f commit 28399be

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/GitHub.Exports/Models/SimpleRepositoryModel.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ public UriString GenerateUrl(string path = null, int startLine = -1, int endLine
9292
endLine = temp;
9393
}
9494

95+
if (startLine == endLine)
96+
{
97+
// if startLine is the same as endLine don't generate a range link
98+
endLine = -1;
99+
}
100+
95101
return new UriString(GenerateUrl(CloneUrl.ToRepositoryUrl().AbsoluteUri, sha, path, startLine, endLine));
96102
}
97103

0 commit comments

Comments
 (0)