From 156e428bafbf76f76bbf7a561a63b2be8c839b7b Mon Sep 17 00:00:00 2001 From: Daylam Tayari Date: Thu, 12 Mar 2026 09:50:28 -0500 Subject: [PATCH] Updated git initialization check in doctor cmd --- cmd/skillshare/doctor.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/skillshare/doctor.go b/cmd/skillshare/doctor.go index 177413774..ff97fac9f 100644 --- a/cmd/skillshare/doctor.go +++ b/cmd/skillshare/doctor.go @@ -411,15 +411,16 @@ func checkSyncDrift(cfg *config.Config, result *doctorResult, discovered []sync. // checkGitStatus checks if source is a git repo and its status func checkGitStatus(source string, result *doctorResult) { - gitDir := filepath.Join(source, ".git") - if _, err := os.Stat(gitDir); os.IsNotExist(err) { + cmd := exec.Command("git", "status") + cmd.Dir = source + if _, err := cmd.Output(); err != nil { ui.Warning("Git: not initialized (recommended for backup)") result.addWarning() return } // Check for uncommitted changes - cmd := exec.Command("git", "status", "--porcelain") + cmd = exec.Command("git", "status", "--porcelain") cmd.Dir = source output, err := cmd.Output() if err != nil {