1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-23 02:38:35 +00:00

Merge branch 'dev' into newcollaboration

This commit is contained in:
Peter Smit
2015-02-05 11:08:10 +02:00
47 changed files with 1297 additions and 359 deletions

View File

@@ -37,7 +37,7 @@ func RenderIssueLinks(oldCommits *list.List, repoLink string) *list.List {
newCommits := list.New()
for e := oldCommits.Front(); e != nil; e = e.Next() {
c := e.Value.(*git.Commit)
c.CommitMessage = string(base.RenderIssueIndexPattern([]byte(c.CommitMessage), repoLink))
c.CommitMessage = c.CommitMessage
newCommits.PushBack(c)
}
return newCommits
@@ -206,7 +206,7 @@ func Diff(ctx *middleware.Context) {
commitId := ctx.Repo.CommitId
commit := ctx.Repo.Commit
commit.CommitMessage = string(base.RenderIssueIndexPattern([]byte(commit.CommitMessage), ctx.Repo.RepoLink))
commit.CommitMessage = commit.CommitMessage
diff, err := models.GetDiffCommit(models.RepoPath(userName, repoName),
commitId, setting.Git.MaxGitDiffLines)
if err != nil {

View File

@@ -25,16 +25,16 @@ func ServeBlob(ctx *middleware.Context, blob *git.Blob) error {
buf = buf[:n]
}
contentType, isTextFile := base.IsTextFile(buf)
_, isTextFile := base.IsTextFile(buf)
_, isImageFile := base.IsImageFile(buf)
ctx.Resp.Header().Set("Content-Type", contentType)
ctx.Resp.Header().Set("Content-Type", "text/plain")
if !isTextFile && !isImageFile {
ctx.Resp.Header().Set("Content-Disposition", "attachment; filename="+path.Base(ctx.Repo.TreeName))
ctx.Resp.Header().Set("Content-Transfer-Encoding", "binary")
}
ctx.Resp.Write(buf)
io.Copy(ctx.Resp, dataRc)
return nil
_, err = io.Copy(ctx.Resp, dataRc)
return err
}
func SingleDownload(ctx *middleware.Context) {

View File

@@ -156,9 +156,9 @@ func Home(ctx *middleware.Context) {
for _, f := range files {
switch c := f[1].(type) {
case *git.Commit:
c.CommitMessage = string(base.RenderIssueIndexPattern([]byte(c.CommitMessage), ctx.Repo.RepoLink))
c.CommitMessage = c.CommitMessage
case *git.SubModuleFile:
c.CommitMessage = string(base.RenderIssueIndexPattern([]byte(c.CommitMessage), ctx.Repo.RepoLink))
c.CommitMessage = c.CommitMessage
}
}
ctx.Data["Files"] = files