Exemple #1
0
 public string CreateCommitLink(string guid, string linkText = null, bool preserveGuidInLinkText = false)
 {
     if (linkText == null)
     {
         if (GitRevision.UnstagedGuid == guid)
         {
             linkText = Strings.GetCurrentUnstagedChanges();
         }
         else if (GitRevision.IndexGuid == guid)
         {
             linkText = Strings.GetCurrentIndex();
         }
         else
         {
             if (preserveGuidInLinkText)
             {
                 linkText = guid;
             }
             else
             {
                 linkText = GitRevision.ToShortSha(guid);
             }
         }
     }
     return(AddLink(linkText, "gitext://gotocommit/" + guid));
 }
 public static string CreateCommitLink(string guid)
 {
     if (GitRevision.UnstagedGuid == guid)
     {
         return("<a href='gitext://gotocommit/" + guid + "'>" + Strings.GetCurrentUnstagedChanges() + "</a>");
     }
     else if (GitRevision.IndexGuid == guid)
     {
         return("<a href='gitext://gotocommit/" + guid + "'>" + Strings.GetCurrentIndex() + "</a>");
     }
     else
     {
         return("<a href='gitext://gotocommit/" + guid + "'>" + guid.Substring(0, 10) + "</a>");
     }
 }
Exemple #3
0
 public string CreateCommitLink(string guid, string linkText = null, bool preserveGuidInLinkText = false)
 {
     if (linkText == null)
     {
         if (GitRevision.UnstagedGuid == guid)
             linkText = Strings.GetCurrentUnstagedChanges();
         else if (GitRevision.IndexGuid == guid)
             linkText = Strings.GetCurrentIndex();
         else
         {
             linkText = preserveGuidInLinkText || guid.Length < 10
                 ? guid
                 : guid.Substring(0, 10);
         }
     }
     return AddLink(linkText, "gitext://gotocommit/" + guid);
 }