Skip to content

Commit bb95701

Browse files
committed
fine tune comments
1 parent 343d751 commit bb95701

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

routers/web/repo/view_home.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,8 @@ func Home(ctx *context.Context) {
298298
return
299299
}
300300

301+
// Check whether the repo is viewable: not in migration, and the code unit should be enabled
302+
// Ideally the "feed" logic should be after this, but old code did so, so keep it as-is.
301303
checkHomeCodeViewable(ctx)
302304
if ctx.Written() {
303305
return
@@ -309,14 +311,15 @@ func Home(ctx *context.Context) {
309311
}
310312
ctx.Data["Title"] = title
311313
ctx.Data["PageIsViewCode"] = true
312-
ctx.Data["RepositoryUploadEnabled"] = setting.Repository.Upload.Enabled
314+
ctx.Data["RepositoryUploadEnabled"] = setting.Repository.Upload.Enabled // show New File / Upload File buttons
313315

314316
if ctx.Repo.Commit == nil || ctx.Repo.Repository.IsEmpty || ctx.Repo.Repository.IsBroken() {
317+
// emtpy or broken repositories need to be handled differently
315318
handleRepoEmptyOrBroken(ctx)
316319
return
317320
}
318321

319-
// Get current git entry user currently looking at.
322+
// get the current git entry which doer user is currently looking at.
320323
entry, err := ctx.Repo.Commit.GetTreeEntryByPath(ctx.Repo.TreePath)
321324
if err != nil {
322325
HandleGitError(ctx, "Repo.Commit.GetTreeEntryByPath", err)
@@ -343,6 +346,7 @@ func Home(ctx *context.Context) {
343346
ctx.Data["TreeNames"] = treeNames
344347
ctx.Data["BranchLink"] = branchLink
345348

349+
// some UI components are only shown when the tree path is root
346350
isTreePathRoot := ctx.Repo.TreePath == ""
347351

348352
prepareFuncs := []func(*context.Context){

0 commit comments

Comments
 (0)