fix(routing): default to Maintainer when no git remote exists (#1185)
When no git remote is configured, DetectUserRole() now defaults to Maintainer instead of Contributor. This fixes issue routing for: 1. New personal projects (no remote configured yet) 2. Intentionally local-only repositories Previously, issues would silently route to ~/.beads-planning instead of the local .beads/ directory. Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -29,7 +29,7 @@ const (
|
||||
// Detection strategy:
|
||||
// 1. Check if user has push access to origin (git remote -v shows write URL)
|
||||
// 2. Check git config for beads.role setting (explicit override)
|
||||
// 3. Fall back to contributor if uncertain
|
||||
// 3. Fall back to maintainer for local projects (no remote configured)
|
||||
func DetectUserRole(repoPath string) (UserRole, error) {
|
||||
// First check for explicit role in git config
|
||||
output, err := gitCommandRunner(repoPath, "config", "--get", "beads.role")
|
||||
@@ -49,8 +49,8 @@ func DetectUserRole(repoPath string) (UserRole, error) {
|
||||
// Fallback to standard fetch URL if push URL fails (some git versions/configs)
|
||||
output, err = gitCommandRunner(repoPath, "remote", "get-url", "origin")
|
||||
if err != nil {
|
||||
// No remote or error - default to contributor
|
||||
return Contributor, nil
|
||||
// No remote means local project - default to maintainer
|
||||
return Maintainer, nil
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user