forked from tangled.org/core
this repo has no description

appview: restore old behavior when non-default branches are pushed

Signed-off-by: oppiliappan <me@oppi.li>

oppi.li 04e49c1b d51ccd35

verified
Changed files
+7 -10
appview
repo
+7 -10
appview/repo/index.go
···
RepoInfo: repoInfo,
})
return
-
} else {
-
rp.pages.Error503(w)
-
log.Println("failed to build index response", err)
-
return
}
}
tagMap := make(map[string][]string)
···
}
// if no ref specified, use default branch or first available
-
if ref == "" && len(branchesResp.Branches) > 0 {
for _, branch := range branchesResp.Branches {
if branch.IsDefault {
ref = branch.Name
break
}
-
}
-
if ref == "" {
-
ref = branchesResp.Branches[0].Name
}
}
-
// check if repo is empty
-
if len(branchesResp.Branches) == 0 {
return &types.RepoIndexResponse{
IsEmpty: true,
Branches: branchesResp.Branches,
···
RepoInfo: repoInfo,
})
return
}
+
+
rp.pages.Error503(w)
+
log.Println("failed to build index response", err)
+
return
}
tagMap := make(map[string][]string)
···
}
// if no ref specified, use default branch or first available
+
if ref == "" {
for _, branch := range branchesResp.Branches {
if branch.IsDefault {
ref = branch.Name
break
}
}
}
+
// if ref is still empty, this means the default branch is not set
+
if ref == "" {
return &types.RepoIndexResponse{
IsEmpty: true,
Branches: branchesResp.Branches,