Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions internal/system/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,19 @@ func InstallHomebrew() error {
}

func GetGitConfig(key string) string {
// Try global first (most common)
output, err := RunCommandSilent("git", "config", "--global", key)
if err != nil {
return ""
if err == nil && output != "" {
return output
}

// Fall back to any available config (local, system, etc.)
output, err = RunCommandSilent("git", "config", key)
if err == nil {
return output
Comment on lines 72 to +81
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change adds new behavior (fallback to non-global git config scopes), but the existing tests only validate the global case. Please add a test that sets user.name/user.email in a local repo config (or system config) while keeping global unset, and assert GetGitConfig returns the non-global value to prevent regressions of the original bug.

Copilot uses AI. Check for mistakes.
}
return output

return ""
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The blank lines in this function contain trailing whitespace (tabs/spaces). Please run gofmt / remove the whitespace so the file stays clean and avoids noisy diffs in future changes.

Copilot uses AI. Check for mistakes.
}

func GetExistingGitConfig() (name, email string) {
Expand Down
Loading