Browse Source

fix 500 when edit hook (#8782) (#8789)

release/v1.10
Lunny Xiao 3 years ago
committed by Lauris BH
parent
commit
2236375d66
  1. 5
      modules/git/hook.go

5
modules/git/hook.go

@ -90,6 +90,11 @@ func (h *Hook) Update() error {
h.IsActive = false
return nil
}
d := filepath.Dir(h.path)
if err := os.MkdirAll(d, os.ModePerm); err != nil {
return err
}
err := ioutil.WriteFile(h.path, []byte(strings.Replace(h.Content, "\r", "", -1)), os.ModePerm)
if err != nil {
return err

Loading…
Cancel
Save