Documentation
¶
Overview ¶
Package gitops 封裝所有 git 操作,根據 workspace config 決定 monorepo 或 multi-repo 模式。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyFileIfExists ¶
CopyFileIfExists 複製檔案,來源不存在時靜默忽略(回 nil);讀寫失敗回傳 error。供外部 package 使用。
func CopyFileIfNewer ¶
CopyFileIfNewer 僅在來源比目標新(或目標不存在)時複製,用於差量化 worktree sync, 避免每輪 final sync 與每 2 秒 live-sync 對未變更檔案重複全量複製。 回傳是否實際複製、以及錯誤;來源不存在視為靜默成功(false, nil)。 比對採 mtime-only:dst 不存在則複製;兩者皆存在時 srcInfo.ModTime().After(dstInfo.ModTime()) 才複製。
Types ¶
type MergeResult ¶
type MergeResult struct {
Skipped bool
Conflict bool
Error string
Files []string
ConflictRepo string
}
MergeResult 描述 Merge 操作的結果。
type Ops ¶
type Ops interface {
SetupWorktree(featureID string) (wtRoot string, err error)
Commit(wtRoot, featureID, msg string) error
Merge(featureID, featureName string) MergeResult
Cleanup(featureID string) error
DetectChangedRepos() []string
CaptureBaseline(featureID string, featureRepos []string) error
IsMultiRepo() bool
}
Ops 封裝所有 git 操作,根據 workspace config 決定 monorepo 或 multi-repo 模式。
Click to show internal directories.
Click to hide internal directories.