Documentation
¶
Index ¶
- func NewClient() (interfaces.GitOperations, error)
- func NewClientForTest(config *types.GitConfig, exec executor) interfaces.GitOperations
- type Client
- func (c *Client) Add(files string) (string, error)
- func (c *Client) BranchList(remote bool) ([]types.BranchInfo, error)
- func (c *Client) Checkout(branch string, create bool) (string, error)
- func (c *Client) CheckoutRemote(remoteBranch string, localBranch string) (string, error)
- func (c *Client) Clean(operation string, dryRun bool) (string, error)
- func (c *Client) Commit(message string) (string, error)
- func (c *Client) ConflictStatus() (string, error)
- func (c *Client) CreateBackup(name string) (string, error)
- func (c *Client) CreateFile(path, content string) (string, error)
- func (c *Client) DetectPotentialConflicts(sourceBranch string, targetBranch string) (string, error)
- func (c *Client) DiffFiles(staged bool) (string, error)
- func (c *Client) ForcePush(branch string, force bool) (string, error)
- func (c *Client) GetChangedFiles(staged bool) (string, error)
- func (c *Client) GetCurrentBranch() string
- func (c *Client) GetFileContent(filePath, ref string) (string, error)
- func (c *Client) GetFileSHA(filePath string) (string, error)
- func (c *Client) GetLastCommit() (string, error)
- func (c *Client) GetRemoteURL() string
- func (c *Client) GetRepoPath() string
- func (c *Client) HasGit() bool
- func (c *Client) Init(path string, initialBranch string) (string, error)
- func (c *Client) IsGitRepo() bool
- func (c *Client) ListFiles(ref string) (string, error)
- func (c *Client) LogAnalysis(limit string) (string, error)
- func (c *Client) Merge(sourceBranch string, targetBranch string) (string, error)
- func (c *Client) Pull(branch string) (string, error)
- func (c *Client) PullWithStrategy(branch string, strategy string) (string, error)
- func (c *Client) Push(branch string) (string, error)
- func (c *Client) PushUpstream(branch string) (string, error)
- func (c *Client) Rebase(branch string) (string, error)
- func (c *Client) Remote(operation, name, url string) (string, error)
- func (c *Client) Reset(mode string, target string, files []string) (string, error)
- func (c *Client) ResolveConflicts(strategy string) (string, error)
- func (c *Client) ResolveFile(filePath string, strategy string, customContent *string) (string, error)
- func (c *Client) SafeMerge(source string, target string) (string, error)
- func (c *Client) SetWorkspace(workspacePath string) (string, error)
- func (c *Client) ShowConflict(filePath string) (string, error)
- func (c *Client) Stash(operation, name string) (string, error)
- func (c *Client) Status() (string, error)
- func (c *Client) SyncWithRemote(remoteBranch string) (string, error)
- func (c *Client) Tag(operation, tagName, message string) (string, error)
- func (c *Client) UpdateFile(path, content, _ string) (string, error)
- func (c *Client) ValidateCleanState() (bool, error)
- func (c *Client) ValidateRepo(path string) (string, error)
- type ConflictDetails
- type ConflictMarker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
func NewClient() (interfaces.GitOperations, error)
NewClient crea un nuevo cliente Git y detecta el entorno.
func NewClientForTest ¶
func NewClientForTest(config *types.GitConfig, exec executor) interfaces.GitOperations
NewClientForTest crea un cliente con un ejecutor específico para pruebas.
Types ¶
type Client ¶
Client es el cliente para interactuar con Git.
func (*Client) Add ¶
Add añade archivos al staging area. Soporta múltiples archivos separados por espacios o comas.
func (*Client) BranchList ¶
func (c *Client) BranchList(remote bool) ([]types.BranchInfo, error)
func (*Client) CheckoutRemote ¶
func (*Client) ConflictStatus ¶
Métodos para acceder a la configuración
func (*Client) DetectPotentialConflicts ¶
func (*Client) GetCurrentBranch ¶
func (*Client) GetFileContent ¶
func (*Client) GetLastCommit ¶
func (*Client) GetRemoteURL ¶
func (*Client) GetRepoPath ¶
func (*Client) PullWithStrategy ¶
func (*Client) Reset ¶
Reset realiza un reset a un commit especificado con el modo indicado (hard, soft, mixed)
func (*Client) ResolveConflicts ¶
func (*Client) ResolveFile ¶
func (c *Client) ResolveFile(filePath string, strategy string, customContent *string) (string, error)
ResolveFile resuelve un archivo específico en conflicto
func (*Client) ShowConflict ¶
ShowConflict muestra los detalles de un conflicto en un archivo específico
func (*Client) SyncWithRemote ¶
func (*Client) ValidateCleanState ¶
type ConflictDetails ¶
type ConflictDetails struct {
File string `json:"file"`
HasBase bool `json:"hasBase"`
Markers []ConflictMarker `json:"markers"`
Content string `json:"content,omitempty"`
Suggestion string `json:"suggestion"`
}
type ConflictMarker ¶
type ConflictMarker struct {
Ours string `json:"ours"`
Theirs string `json:"theirs"`
Base string `json:"base,omitempty"`
}
Helper types para manejo de conflicts
Click to show internal directories.
Click to hide internal directories.