Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
FuXiaoHei 2014-04-12 13:51:09 +08:00
commit fe4750ebe2
3 changed files with 11 additions and 0 deletions

View File

@ -300,6 +300,12 @@ func ParsePatch(reader io.Reader) (*Diff, error) {
} }
i = i + 1 i = i + 1
// Diff data too large.
if i == 2000 {
return &Diff{}, nil
}
if line == "" { if line == "" {
continue continue
} }

View File

@ -103,6 +103,7 @@ func Diff(ctx *middleware.Context, params martini.Params) {
ctx.Data["Title"] = commit.Message() + " · " + base.ShortSha(commitId) ctx.Data["Title"] = commit.Message() + " · " + base.ShortSha(commitId)
ctx.Data["Commit"] = commit ctx.Data["Commit"] = commit
ctx.Data["Diff"] = diff ctx.Data["Diff"] = diff
ctx.Data["DiffNotAvailable"] = diff.NumFiles() == 0
ctx.Data["IsRepoToolbarCommits"] = true ctx.Data["IsRepoToolbarCommits"] = true
ctx.Data["SourcePath"] = "/" + path.Join(userName, repoName, "src", commitId) ctx.Data["SourcePath"] = "/" + path.Join(userName, repoName, "src", commitId)
ctx.Data["RawPath"] = "/" + path.Join(userName, repoName, "raw", commitId) ctx.Data["RawPath"] = "/" + path.Join(userName, repoName, "raw", commitId)

View File

@ -20,6 +20,9 @@
</div> </div>
</div> </div>
{{if .DiffNotAvailable}}
<h4>Diff Data Not Available.</h4>
{{else}}
<div class="diff-detail-box diff-box"> <div class="diff-detail-box diff-box">
<a class="pull-right btn btn-default" data-toggle="collapse" data-target="#diff-files">Show Diff Stats</a> <a class="pull-right btn btn-default" data-toggle="collapse" data-target="#diff-files">Show Diff Stats</a>
<p class="showing"> <p class="showing">
@ -97,6 +100,7 @@
</div> </div>
</div> </div>
{{end}} {{end}}
{{end}}
</div> </div>
</div> </div>
{{template "base/footer" .}} {{template "base/footer" .}}