worktree

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFileHash

func GetFileHash(filePath string) (string, error)

GetFileHash はファイルのMD5ハッシュを計算する

func GitRoot

func GitRoot(dir string) (string, error)

GitRoot は指定ディレクトリの Git リポジトリルートを返す

Types

type Worktree

type Worktree struct {
	Name     string  `json:"name"`
	Path     string  `json:"path"`
	Current  bool    `json:"current"`
	FileHash *string `json:"fileHash,omitempty"`
}

Worktree はgit worktreeの情報を表す

func FindByName

func FindByName(worktrees []Worktree, name string) *Worktree

FindByName は名前でworktreeを検索する

func List

func List(basePath string) ([]Worktree, error)

List は指定されたパスのgitリポジトリに関連するworktree一覧を返す

func ListWithHashes

func ListWithHashes(basePath string, relSubdir string, relativePath string) ([]Worktree, error)

ListWithHashes はworktree一覧を返し、指定されたファイルパスのハッシュを含める。 relSubdir は basePath(git root)からユーザーが指定したルートまでの相対パス。 "."(または空文字)なら git root をそのまま basePath とみなす。

Jump to

Keyboard shortcuts

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