summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorFilippo Valsorda <filippo@cloudflare.com>2015-03-10 03:08:17 +0000
committerFilippo Valsorda <filippo@cloudflare.com>2015-03-10 03:08:17 +0000
commit5d5d774e03ea02b29ff2bd25e1bf63ce82851fc5 (patch)
tree953cddb2e3194926266ee9f9e28b3ee235be11a1 /routers
parent5e763baa12e346f8eb577073399068802fa5d67a (diff)
downloadgitea-5d5d774e03ea02b29ff2bd25e1bf63ce82851fc5.tar.gz
gitea-5d5d774e03ea02b29ff2bd25e1bf63ce82851fc5.zip
Handle submodules without a .gitmodules entry - fix #1023
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/view.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/routers/repo/view.go b/routers/repo/view.go
index cfe0fa010c..2a36db6b42 100644
--- a/routers/repo/view.go
+++ b/routers/repo/view.go
@@ -141,13 +141,17 @@ func Home(ctx *middleware.Context) {
ctx.Handle(500, "GetSubModule", err)
return
}
+ smUrl := ""
+ if sm != nil {
+ smUrl = sm.Url
+ }
c, err := ctx.Repo.Commit.GetCommitOfRelPath(filepath.Join(treePath, te.Name()))
if err != nil {
ctx.Handle(500, "GetCommitOfRelPath", err)
return
}
- files = append(files, []interface{}{te, git.NewSubModuleFile(c, sm.Url, te.Id.String())})
+ files = append(files, []interface{}{te, git.NewSubModuleFile(c, smUrl, te.Id.String())})
}
}
ctx.Data["Files"] = files