aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorskyblue <ssx205@gmail.com>2014-04-12 23:19:22 +0800
committerskyblue <ssx205@gmail.com>2014-04-12 23:19:22 +0800
commitf92851e347c6db6468555373bd43c7b507c5fce9 (patch)
tree1eaa45ea5e973edd4f6b39fd92c0a0b4f36b98d5 /models
parent2ce0c3befef3becd48660e600ef70e8affd5bc7c (diff)
parent802a110e4255d0860c3942feffd23b2376c75eb7 (diff)
downloadgitea-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.go8
-rw-r--r--models/repo.go6
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 {