Documentation
¶
Overview ¶
Package codeindex indexes a bounded snapshot of tracked UTF-8 text files from a clean Git checkout using the native git executable and the standard library. File bytes come from immutable Git blobs at the captured commit, not from mutable worktree paths.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrDirtyWorktree means the checkout has uncommitted or untracked changes. ErrDirtyWorktree = errors.New("worktree is not clean") // ErrNoCommit means the repository has no HEAD commit. ErrNoCommit = errors.New("no commit found") // ErrNotARepository means repoPath is not inside a non-bare git worktree. ErrNotARepository = errors.New("not a git repository") )
Functions ¶
This section is empty.
Types ¶
type Snapshot ¶
type Snapshot struct {
RepoPath string
Commit string
CreatedAt time.Time
Documents []Document
TotalBytes int
}
Snapshot identifies a repository checkout and the documents indexed from it.
func Index ¶
Index enumerates tracked files in repoPath and returns a bounded Snapshot. It requires a clean, non-bare checkout and rejects paths that escape the repository root. Only regular tracked files are read; symlinks, binaries, non-UTF-8 content, and files exceeding the configured limits are skipped.
Click to show internal directories.
Click to hide internal directories.