gitindex

package
v0.1.23-oss Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckStatus

func CheckStatus(workdir, filename string) error

func NewCmd

func NewCmd(rootCmd *root.RootCmd) *gitIndexCmd

Types

type DiffData

type DiffData struct {
	FileA       string                `json:"fileA"`
	FileB       string                `json:"fileB"`
	Diffs       bool                  `json:"diffs"`
	HeaderA     *git.IndexHeader      `json:"headerA,omitempty"`
	HeaderB     *git.IndexHeader      `json:"headerB,omitempty"`
	EntryDiffs  []EntryDiff           `json:"entry_diffs,omitempty"`
	EntryNotInA []Entry               `json:"entry_not_in_a,omitempty"`
	EntryNotInB []Entry               `json:"entry_not_in_b,omitempty"`
	TreeDiffs   []TreeDiff            `json:"tree_diffs,omitempty"`
	TreeNotInA  []*git.CacheTreeEntry `json:"tree_not_in_a,omitempty"`
	TreeNotInB  []*git.CacheTreeEntry `json:"tree_not_in_b,omitempty"`
}

func DiffIndexes

func DiffIndexes(aInfo, bInfo *indexInfo) (*DiffData, error)

type Entry

type Entry struct {
	Mode     uint32        `json:"mode"`
	FileSize uint32        `json:"filesize"`
	SHA1     git.IndexSha1 `json:"sha1"`
	Flags    uint16        `json:"flags"`
	Name     string        `json:"name"`
}

Remove items not used for compare

type EntryDiff

type EntryDiff struct {
	A Entry `json:"entryA"`
	B Entry `json:"entryB"`
}

type Index

type Index struct {
	Header   git.IndexHeader
	IndexMap map[string]Entry
	TreeMap  map[string]*git.CacheTreeEntry
}

Index structure for easier lookup and adding paths to tree items

func NewIndex

func NewIndex(gitIndex *git.Index) *Index

type TreeDiff

type TreeDiff struct {
	A *git.CacheTreeEntry `json:"treeA"`
	B *git.CacheTreeEntry `json:"treeB"`
}

Jump to

Keyboard shortcuts

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