diff options
author | Unknwon <u@gogs.io> | 2015-12-14 09:38:21 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-12-14 09:38:21 -0500 |
commit | 50264200f04d227ce5e36792cb7b951789693570 (patch) | |
tree | 3e94d9bde04308031216565ef32130d0b7ac26de /models/git_diff.go | |
parent | 7436ce640394d06129d8c10f7b69f28135892126 (diff) | |
download | gitea-50264200f04d227ce5e36792cb7b951789693570.tar.gz gitea-50264200f04d227ce5e36792cb7b951789693570.zip |
fix huge diff hangs
Diffstat (limited to 'models/git_diff.go')
-rw-r--r-- | models/git_diff.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/models/git_diff.go b/models/git_diff.go index 725806699e..2113250451 100644 --- a/models/git_diff.go +++ b/models/git_diff.go @@ -9,6 +9,7 @@ import ( "bytes" "fmt" "io" + "io/ioutil" "os" "os/exec" "strings" @@ -124,6 +125,7 @@ func ParsePatch(maxlines int, reader io.Reader) (*Diff, error) { // Diff data too large, we only show the first about maxlines lines if lineCount >= maxlines { log.Warn("Diff data too large") + io.Copy(ioutil.Discard, reader) diff.Files = nil return diff, nil } |