forked from gitextensions/gitextensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLinkFactory.cs
27 lines (24 loc) · 1 KB
/
LinkFactory.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System.Net;
namespace GitCommands
{
public class LinkFactory
{
public static string CreateTagLink(string tag)
{
return "<a href='gitex://gototag/" + tag + "'>" + WebUtility.HtmlEncode(tag) + "</a>";
}
public static string CreateBranchLink(string noPrefixBranch)
{
return "<a href='gitex://gotobranch/" + noPrefixBranch + "'>" + WebUtility.HtmlEncode(noPrefixBranch) + "</a>";
}
public static string CreateCommitLink(string guid)
{
if (GitRevision.UnstagedGuid == guid)
return "<a href='gitex://gotocommit/" + guid + "'>" + Strings.GetCurrentUnstagedChanges() + "</a>";
else if (GitRevision.IndexGuid == guid)
return "<a href='gitex://gotocommit/" + guid + "'>" + Strings.GetCurrentIndex() + "</a>";
else
return "<a href='gitex://gotocommit/" + guid + "'>" + guid.Substring(0, 10) + "</a>";
}
}
}