diff

package
v0.3.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package diff implements diff metadata parsing and merge logic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetadataService

type MetadataService struct {
	Runner gitexec.GitRunner
}

MetadataService lists files changed between two commits.

func (*MetadataService) ListFiles

ListFiles returns file summaries in the order emitted by git diff --name-status. It runs two git commands (--name-status -z and --numstat -z), parses the NUL-delimited output, and merges counts into the authoritative ordering.

type OversizedError

type OversizedError struct {
	Bytes int
	Lines int
}

OversizedError wraps ErrOversized with the measured byte size and line count so the UI can display them in the fallback message.

func (*OversizedError) Error

func (e *OversizedError) Error() string

func (*OversizedError) Unwrap

func (e *OversizedError) Unwrap() error

type PatchService

type PatchService struct {
	Runner gitexec.GitRunner
}

PatchService loads and parses unified diffs for individual files.

func (*PatchService) LoadPatch

func (s *PatchService) LoadPatch(ctx context.Context, cmp model.ResolvedCompare, filePath string, status model.FileStatus, ignoreWhitespace bool) (model.FilePatch, error)

LoadPatch runs git diff --patch for a single file and parses the result. For untracked files (status == StatusUntracked), it uses --no-index against /dev/null.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL