+5
-1
knotserver/git/git.go
+5
-1
knotserver/git/git.go
···
230
230
if err != nil {
231
231
return "", fmt.Errorf("unable to find main branch: %w", err)
232
232
}
233
-
return string(ref.Name()), err
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)
234
238
}
235
239
236
240
// WriteTar writes itself from a tree into a binary tar file format.