diff options
author | skyblue <ssx205@gmail.com> | 2014-04-12 23:19:22 +0800 |
---|---|---|
committer | skyblue <ssx205@gmail.com> | 2014-04-12 23:19:22 +0800 |
commit | f92851e347c6db6468555373bd43c7b507c5fce9 (patch) | |
tree | 1eaa45ea5e973edd4f6b39fd92c0a0b4f36b98d5 /models/git.go | |
parent | 2ce0c3befef3becd48660e600ef70e8affd5bc7c (diff) | |
parent | 802a110e4255d0860c3942feffd23b2376c75eb7 (diff) |
Merge branch 'dev' of github.com:gogits/gogs into dev
Diffstat (limited to 'models/git.go')
-rw-r--r-- | models/git.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/models/git.go b/models/git.go index f20e663b..e32b5ba9 100644 --- a/models/git.go +++ b/models/git.go @@ -21,6 +21,7 @@ import ( "github.com/gogits/git" "github.com/gogits/gogs/modules/base" + "github.com/gogits/gogs/modules/log" ) // RepoFile represents a file object in git repository. @@ -300,6 +301,13 @@ func ParsePatch(reader io.Reader) (*Diff, error) { } i = i + 1 + + // Diff data too large. + if i == 5000 { + log.Warn("Diff data too large") + return &Diff{}, nil + } + if line == "" { continue } |