Monorepo for Tangled tangled.org

fix default branch logic

Changed files
+5 -1
knotserver
git
+5 -1
knotserver/git/git.go
··· 230 if err != nil { 231 return "", fmt.Errorf("unable to find main branch: %w", err) 232 } 233 - return string(ref.Name()), err 234 } 235 236 // WriteTar writes itself from a tree into a binary tar file format.
··· 230 if err != nil { 231 return "", fmt.Errorf("unable to find main branch: %w", err) 232 } 233 + if ref.Name().IsBranch() { 234 + return strings.TrimPrefix(string(ref.Name()), "refs/heads/"), nil 235 + } 236 + 237 + return "", fmt.Errorf("unable to find main branch: %w", err) 238 } 239 240 // WriteTar writes itself from a tree into a binary tar file format.