Yoginth %!s(int64=7) %!d(string=hai) anos
pai
achega
cc136d7275
Modificáronse 2 ficheiros con 4 adicións e 4 borrados
  1. 2 2
      pkg/markup/markdown_test.go
  2. 2 2
      pkg/tool/tool.go

+ 2 - 2
pkg/markup/markdown_test.go

@@ -94,8 +94,8 @@ func Test_Markdown(t *testing.T) {
 		Convey("To the internal issue tracker", func() {
 			Convey("It should correctly convert URLs", func() {
 				testCases := []string{
-					"http://localhost:3000/user/project/commit/d8a994ef243349f321568f9e36d5c3f444b99cae", " <code><a href=\"http://localhost:3000/user/project/commit/d8a994ef243349f321568f9e36d5c3f444b99cae\">d8a994ef24</a></code>",
-					"http://localhost:3000/user/project/commit/d8a994ef243349f321568f9e36d5c3f444b99cae#diff-2", " <code><a href=\"http://localhost:3000/user/project/commit/d8a994ef243349f321568f9e36d5c3f444b99cae#diff-2\">d8a994ef24</a></code>",
+					"http://localhost:3000/user/project/commit/d8a994ef243349f321568f9e36d5c3f444b99cae", " <code><a href=\"http://localhost:3000/user/project/commit/d8a994ef243349f321568f9e36d5c3f444b99cae\">d8a994e</a></code>",
+					"http://localhost:3000/user/project/commit/d8a994ef243349f321568f9e36d5c3f444b99cae#diff-2", " <code><a href=\"http://localhost:3000/user/project/commit/d8a994ef243349f321568f9e36d5c3f444b99cae#diff-2\">d8a994e</a></code>",
 					"https://external-link.gitote/gitote/commit/d8a994ef243349f321568f9e36d5c3f444b99cae#diff-2", "<a href=\"https://external-link.gitote/gitote/commit/d8a994ef243349f321568f9e36d5c3f444b99cae#diff-2\">https://external-link.gitote/gitote/commit/d8a994ef243349f321568f9e36d5c3f444b99cae#diff-2</a>",
 					"https://commit/d8a994ef243349f321568f9e36d5c3f444b99cae", "<a href=\"https://commit/d8a994ef243349f321568f9e36d5c3f444b99cae\">https://commit/d8a994ef243349f321568f9e36d5c3f444b99cae</a>",
 				}

+ 2 - 2
pkg/tool/tool.go

@@ -48,8 +48,8 @@ func SHA1(str string) string {
 
 // ShortSHA1 truncates SHA1 string length to at most 10.
 func ShortSHA1(sha1 string) string {
-	if len(sha1) > 10 {
-		return sha1[:10]
+	if len(sha1) > 7 {
+		return sha1[:7]
 	}
 	return sha1
 }