git

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGitRoot

func GetGitRoot() (string, error)

GetGitRoot is exported for use by other packages

Types

type DiffResult

type DiffResult struct {
	// RawDiff is the raw git diff output
	RawDiff string
	// ModifiedFiles maps file paths to their full content
	ModifiedFiles map[string]string
	// FilePaths is a list of all modified file paths
	FilePaths []string
}

DiffResult contains the extracted diff and file contents

func GetDiff

func GetDiff(staged bool, baseBranch string) (*DiffResult, error)

GetDiff extracts the git diff and reads modified file contents If baseBranch is provided, compares against that branch/commit If staged is true, compares staged changes against HEAD Otherwise, compares working directory against HEAD

Jump to

Keyboard shortcuts

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