From d305448fa802a91ba81af1b78294f1658bcf834c Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 11 Apr 2014 23:52:08 -0400 Subject: Mirror bug fix --- models/repo.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'models') diff --git a/models/repo.go b/models/repo.go index ce8665cc..d01a716b 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 { -- cgit v1.2.3 From 31d613c01d313e14cc57fcb183f7489352ff6aa5 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 12 Apr 2014 01:45:43 -0400 Subject: Mirror fix --- models/git.go | 6 ++++++ routers/repo/commit.go | 1 + templates/repo/diff.tmpl | 4 ++++ 3 files changed, 11 insertions(+) (limited to 'models') diff --git a/models/git.go b/models/git.go index f20e663b..10e8ca48 100644 --- a/models/git.go +++ b/models/git.go @@ -300,6 +300,12 @@ func ParsePatch(reader io.Reader) (*Diff, error) { } i = i + 1 + + // Diff data too large. + if i == 10000 { + return &Diff{}, nil + } + if line == "" { continue } diff --git a/routers/repo/commit.go b/routers/repo/commit.go index fed1a6ba..dbfd9af2 100644 --- a/routers/repo/commit.go +++ b/routers/repo/commit.go @@ -103,6 +103,7 @@ func Diff(ctx *middleware.Context, params martini.Params) { ctx.Data["Title"] = commit.Message() + " ยท " + base.ShortSha(commitId) ctx.Data["Commit"] = commit ctx.Data["Diff"] = diff + ctx.Data["DiffNotAvailable"] = diff.NumFiles() == 0 ctx.Data["IsRepoToolbarCommits"] = true ctx.Data["SourcePath"] = "/" + path.Join(userName, repoName, "src", commitId) ctx.Data["RawPath"] = "/" + path.Join(userName, repoName, "raw", commitId) diff --git a/templates/repo/diff.tmpl b/templates/repo/diff.tmpl index a041284d..796a8e94 100644 --- a/templates/repo/diff.tmpl +++ b/templates/repo/diff.tmpl @@ -20,6 +20,9 @@ + {{if .DiffNotAvailable}} +

Diff Data Not Available.

+ {{else}}
Show Diff Stats

@@ -97,6 +100,7 @@

{{end}} + {{end}} {{template "base/footer" .}} -- cgit v1.2.3 From 794b457252b270ae452b3ea946d91b216f27ac5d Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 12 Apr 2014 01:47:59 -0400 Subject: Mirror fix --- models/git.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'models') diff --git a/models/git.go b/models/git.go index 10e8ca48..07f23297 100644 --- a/models/git.go +++ b/models/git.go @@ -302,7 +302,7 @@ func ParsePatch(reader io.Reader) (*Diff, error) { i = i + 1 // Diff data too large. - if i == 10000 { + if i == 2000 { return &Diff{}, nil } -- cgit v1.2.3 From 559a57330e11cdfd0d195cd1a59a73b6c4d49bd8 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 12 Apr 2014 02:08:12 -0400 Subject: Mirror fix --- models/git.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'models') diff --git a/models/git.go b/models/git.go index 07f23297..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. @@ -302,7 +303,8 @@ func ParsePatch(reader io.Reader) (*Diff, error) { i = i + 1 // Diff data too large. - if i == 2000 { + if i == 5000 { + log.Warn("Diff data too large") return &Diff{}, nil } -- cgit v1.2.3