fix: address code review — error-path tests, edge cases, UX improvements

This commit is contained in:
2026-06-10 18:20:54 +08:00
parent 493775cd1e
commit 8d16fabaed
6 changed files with 77 additions and 10 deletions
+6
View File
@@ -338,6 +338,12 @@ func (s *workspaceService) ListBranches(ctx context.Context, c Caller, wsID uuid
} else if !canRead {
return nil, errs.New(errs.CodeForbidden, "no read access")
}
if ws.MainPath == "" {
return nil, errs.New(errs.CodeInvalidInput, "workspace not yet cloned")
}
if _, statErr := os.Stat(ws.MainPath); errors.Is(statErr, os.ErrNotExist) {
return nil, errs.New(errs.CodeInvalidInput, "workspace not yet cloned")
}
cred, err := s.loadDecryptedCredential(ctx, wsID)
if err != nil {
return nil, err