git

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Evidence

func Evidence(ctx context.Context, root, relPath string) domain.VersionEvidence

func HasSnapshot

func HasSnapshot(root string) bool

func HeadCommit

func HeadCommit(ctx context.Context, root string) (string, error)

HeadCommit 返回当前 HEAD commit hash;没有提交时返回空串和 nil。

func RestorePathFromCommit

func RestorePathFromCommit(ctx context.Context, root, commit, path string) error

RestorePathFromCommit 把指定路径的工作区内容恢复到给定 commit。 它是 proof loop 可逆 apply 的底层恢复原语:apply 前已 git commit, 坏 apply 后用 commit hash 把单个文件 checkout 回来,不发明内容。

func Snapshot

func Snapshot(ctx context.Context, root, message string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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