MCPcopy Create free account
hub / github.com/LegacyCodeHQ/clarity-cli / HasUncommittedChanges

Function HasUncommittedChanges

vcs/git/git.go:119–127  ·  view source on GitHub ↗

HasUncommittedChanges checks if there are any uncommitted changes in the repository

(repoPath string)

Source from the content-addressed store, hash-verified

117
118// HasUncommittedChanges checks if there are any uncommitted changes in the repository
119func HasUncommittedChanges(repoPath string) (bool, error) {
120 stdout, stderr, err := runGitCommand(repoPath, "status", "--porcelain")
121 if err != nil {
122 return false, gitCommandError(err, stderr)
123 }
124
125 // If output is not empty, there are uncommitted changes
126 return strings.TrimSpace(string(stdout)) != "", nil
127}
128
129// ParseCommitRange parses a commit specification and returns the from/to commits.
130// Supports formats: "abc...def", "abc..def", or single commit "abc"

Calls 2

runGitCommandFunction · 0.85
gitCommandErrorFunction · 0.85