Documentation
¶
Index ¶
- func ApplySelectedChangesToFile(filePath string, repoRoot string, diffText string, ...) (string, string, error)
- func CalculateGitHash(repoPath, filePath string) (string, error)
- func Commit(message string, repoRoot string) error
- func CommitAmend(message string, repoRoot string) error
- func FindGitRoot(startPath string) (string, error)
- func GetChangedFiles(repoPath string) ([]FileInfo, []FileInfo, []FileInfo, error)
- func GetFileContentFromHEAD(filePath string, repoRoot string) ([]byte, error)
- func GetFileContentFromIndex(filePath string, repoRoot string) ([]byte, error)
- func GetFileDiff(filePath string, repoRoot string) (string, error)
- func GetFileDiffWithOptions(filePath string, repoRoot string, ignoreWhitespace bool) (string, error)
- func GetStagedDiff(filePath string, repoRoot string) (string, error)
- func GetStagedDiffWithOptions(filePath string, repoRoot string, ignoreWhitespace bool) (string, error)
- func RevertSelectedChangesFromStaged(filePath string, repoRoot string, stagedDiffText string, ...) (string, error)
- type FileInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplySelectedChangesToFile ¶
func ApplySelectedChangesToFile(filePath string, repoRoot string, diffText string, selectedStart, selectedEnd int) (string, string, error)
ApplySelectedChangesToFile returns file content with only selected changes applied It preserves existing staged changes and applies new selections on top
func CalculateGitHash ¶
CalculateGitHash calculates the Git-style hash for a file.
func CommitAmend ¶
func FindGitRoot ¶
FindGitRoot searches for the .git directory by traversing up from the current directory
func GetChangedFiles ¶
func GetFileContentFromHEAD ¶
GetFileContentFromHEAD returns file content at HEAD
func GetFileContentFromIndex ¶
GetFileContentFromIndex returns file content from git index (staging area)
func GetFileDiffWithOptions ¶
func RevertSelectedChangesFromStaged ¶
func RevertSelectedChangesFromStaged(filePath string, repoRoot string, stagedDiffText string, selectedStart, selectedEnd int) (string, error)
RevertSelectedChangesFromStaged returns file content with selected changes reverted from staging It takes the staged diff and reverts only the selected lines back to HEAD state
Types ¶
Click to show internal directories.
Click to hide internal directories.