Add basic submodule support

This commit is contained in:
Unknwon 2014-09-22 17:01:19 -04:00
parent 063aacd436
commit 3f707b3f32
6 changed files with 57 additions and 19 deletions

View file

@ -21,13 +21,6 @@ const (
HOME base.TplName = "repo/home"
)
type fakeCommit struct {
*git.Commit
RefUrl string
RefId string
}
func Home(ctx *middleware.Context) {
ctx.Data["Title"] = ctx.Repo.Repository.Name
@ -153,14 +146,7 @@ func Home(ctx *middleware.Context) {
ctx.Handle(404, "GetCommitOfRelPath", err)
return
}
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, git.NewSubModuleFile(c, sm.Url, te.Id.String())})
}
}