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 | |
parent | 2ce0c3befef3becd48660e600ef70e8affd5bc7c (diff) | |
parent | 802a110e4255d0860c3942feffd23b2376c75eb7 (diff) | |
download | gitea-f92851e347c6db6468555373bd43c7b507c5fce9.tar.gz gitea-f92851e347c6db6468555373bd43c7b507c5fce9.zip |
Merge branch 'dev' of github.com:gogits/gogs into dev
Diffstat (limited to 'models')
-rw-r--r-- | models/git.go | 8 | ||||
-rw-r--r-- | models/repo.go | 6 |
2 files changed, 12 insertions, 2 deletions
diff --git a/models/git.go b/models/git.go index f20e663b1b..e32b5ba96e 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 } diff --git a/models/repo.go b/models/repo.go index ce8665cc63..d01a716b50 100644 --- a/models/repo.go +++ b/models/repo.go @@ -192,8 +192,10 @@ func CreateRepository(user *User, repoName, desc, repoLang, license string, priv return nil, err } - if err = NewRepoAction(user, repo); err != nil { - log.Error("repo.CreateRepository(NewRepoAction): %v", err) + if !repo.IsPrivate { + if err = NewRepoAction(user, repo); err != nil { + log.Error("repo.CreateRepository(NewRepoAction): %v", err) + } } if err = WatchRepo(user.Id, repo.Id, true); err != nil { |