From: Unknwon Date: Sat, 11 Oct 2014 22:20:07 +0000 (-0400) Subject: Fix diff css style, hooks \r char X-Git-Tag: v0.9.99~1713 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3005c4f6db725e0e637987d3ac154865526c1363;p=gitea.git Fix diff css style, hooks \r char --- diff --git a/modules/git/hooks.go b/modules/git/hooks.go index b8d15e5e75..5b3c88a931 100644 --- a/modules/git/hooks.go +++ b/modules/git/hooks.go @@ -83,7 +83,7 @@ func (h *Hook) Update() error { if len(strings.TrimSpace(h.Content)) == 0 { return os.Remove(h.path) } - return ioutil.WriteFile(h.path, []byte(h.Content), os.ModePerm) + return ioutil.WriteFile(h.path, []byte(strings.Replace(h.Content, "\r", "", -1)), os.ModePerm) } // ListHooks returns a list of Git hooks of given repository. diff --git a/templates/repo/diff.tmpl b/templates/repo/diff.tmpl index 30a983ac90..9dac1cac97 100644 --- a/templates/repo/diff.tmpl +++ b/templates/repo/diff.tmpl @@ -74,7 +74,7 @@ {{range .Diff.Files}} -
+
{{if not .IsBin}}