{"modulePath":"github.com/nuitsjp/commit-spark","version":"v0.1.0","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package gitutil\n\nPackage gitutil wraps the git CLI operations needed by commit-spark.\n\n## Functions\n\n```go\nfunc AssertGitRepo(ctx context.Context) (string, error)\n```\nAssertGitRepo runs \\`git rev-parse --show-toplevel\\`. It returns the repo root path, or \\*apperr.KnownError if the current directory is not inside a Git repository.\n\n## Types\n\n```go\ntype StagedDiff struct {\n\tFiles []string\n\tDiff  string\n}\n```\nStagedDiff is the result of GetStagedDiff.\n\n```go\nfunc GetStagedDiff(ctx context.Context, excludeFiles []string) (*StagedDiff, error)\n```\nGetStagedDiff runs \\`git diff --cached --diff-algorithm=minimal\\`, applying the same lock-file auto-exclusion logic as the original TypeScript implementation: if any staged file is NOT a lock file, lock files (package-lock.json, pnpm-lock.yaml, \\*.lock) are excluded from the diff; if ALL staged files are lock files, they are kept. Returns (nil, nil) if there's nothing staged after exclusion.\n\n","path":"github.com/nuitsjp/commit-spark/internal/gitutil","name":"gitutil","synopsis":"Package gitutil wraps the git CLI operations needed by commit-spark.","isRedistributable":true}
