changed layout of repo settings page

This commit is contained in:
2026-05-07 12:32:07 +02:00
parent 39dd9ab9eb
commit 00aede9c91
5 changed files with 525 additions and 69 deletions
+12
View File
@@ -271,6 +271,18 @@ func Branches(repoPath string) ([]Branch, error) {
return branches, nil
}
// RepoSize returns the total byte size of the bare repo directory by walking it.
func RepoSize(repoPath string) int64 {
var total int64
filepath.Walk(repoPath, func(_ string, info os.FileInfo, err error) error {
if err == nil && !info.IsDir() {
total += info.Size()
}
return nil
})
return total
}
// SetDefaultBranch updates HEAD to point at the given branch name.
func SetDefaultBranch(repoPath, branch string) error {
_, err := run(repoPath, "symbolic-ref", "HEAD", "refs/heads/"+branch)