remove extra info from diff-file shown

This commit is contained in:
Arya Kiran
2023-03-20 16:50:06 +05:30
parent 15645df84d
commit 8f010ade2a
+3
View File
@@ -14,6 +14,7 @@ import (
"log"
"net/http"
"os"
"regexp"
"strings"
)
@@ -55,6 +56,8 @@ func HandleCommit(c *fiber.Ctx) error {
"error": err,
})
}
re := regexp.MustCompile("\\A(?s).*?---(?-s).*\\n")
file = re.ReplaceAllString(file, "---\n")
lexer := lexers.Match("something.diff")
if lexer == nil {
lexer = lexers.Fallback