Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplyOptions ¶
type ApplyOptions struct {
CreateBackup bool
BackupSuffix string
DryRun bool
IgnoreWhitespace bool
}
ApplyOptions configures patch application behavior
func DefaultApplyOptions ¶
func DefaultApplyOptions() ApplyOptions
DefaultApplyOptions returns sensible defaults for patch application
type ApplyResult ¶
type ApplyResult struct {
FilePath string `json:"file_path"`
Success bool `json:"success"`
Error string `json:"error,omitempty"`
BackupPath string `json:"backup_path,omitempty"`
HunksApplied int `json:"hunks_applied"`
LinesChanged int `json:"lines_changed"`
OriginalSize int `json:"original_size"`
NewSize int `json:"new_size"`
}
ApplyResult contains information about the patch application
type PatchApplier ¶
type PatchApplier struct {
// contains filtered or unexported fields
}
PatchApplier handles applying patches to files
func NewPatchApplier ¶
func NewPatchApplier(workspaceRoot string, options ApplyOptions) *PatchApplier
NewPatchApplier creates a new patch applier
func (*PatchApplier) ApplyMultiplePatches ¶
func (pa *PatchApplier) ApplyMultiplePatches(patches map[string]string) ([]ApplyResult, error)
ApplyMultiplePatches applies multiple patches with rollback on failure
func (*PatchApplier) ApplyPatch ¶
func (pa *PatchApplier) ApplyPatch(filePath, patchContent string) (*ApplyResult, error)
ApplyPatch applies a unified diff patch to a file
Click to show internal directories.
Click to hide internal directories.