|
|
@ -10,7 +10,6 @@ import ( |
|
|
|
"path" |
|
|
|
"path" |
|
|
|
"path/filepath" |
|
|
|
"path/filepath" |
|
|
|
"strings" |
|
|
|
"strings" |
|
|
|
"time" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/gogits/gogs/modules/base" |
|
|
|
"github.com/gogits/gogs/modules/base" |
|
|
|
"github.com/gogits/gogs/modules/git" |
|
|
|
"github.com/gogits/gogs/modules/git" |
|
|
@ -23,12 +22,10 @@ const ( |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
type fakeCommit struct { |
|
|
|
type fakeCommit struct { |
|
|
|
Id string |
|
|
|
*git.Commit |
|
|
|
Summary string |
|
|
|
|
|
|
|
Url string |
|
|
|
RefUrl string |
|
|
|
Committer struct { |
|
|
|
RefId string |
|
|
|
When time.Time |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func Home(ctx *middleware.Context) { |
|
|
|
func Home(ctx *middleware.Context) { |
|
|
@ -151,13 +148,16 @@ func Home(ctx *middleware.Context) { |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
commit := git.Commit{ |
|
|
|
c, err := ctx.Repo.Commit.GetCommitOfRelPath(filepath.Join(treePath, te.Name())) |
|
|
|
Tree: *tree, |
|
|
|
if err != nil { |
|
|
|
Id: te.Id, |
|
|
|
ctx.Handle(404, "GetCommitOfRelPath", err) |
|
|
|
Committer: &git.Signature{ |
|
|
|
return |
|
|
|
When: time.Now(), |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
CommitMessage: sm.Url, |
|
|
|
commit := fakeCommit{ |
|
|
|
|
|
|
|
Commit: c, |
|
|
|
|
|
|
|
RefUrl: strings.TrimRight(sm.Url, ".git"), |
|
|
|
|
|
|
|
RefId: te.Id.String(), |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
files = append(files, []interface{}{te, &commit}) |
|
|
|
files = append(files, []interface{}{te, &commit}) |
|
|
|