MCPcopy Create free account
hub / github.com/diillson/chatcli / GetFileDiff

Function GetFileDiff

utils/git_utils.go:103–110  ·  view source on GitHub ↗

Funções abaixo serão implementadas em nova Feature planejada. :D Função auxiliar para obter diferenças específicas de um arquivo

(filepath string)

Source from the content-addressed store, hash-verified

101
102// Função auxiliar para obter diferenças específicas de um arquivo
103func GetFileDiff(filepath string) (string, error) {
104 cmd := exec.Command("git", "diff", filepath) //#nosec G204 -- agent/CLI tool execution; commands validated by command_validator + policy_manager upstream
105 output, err := cmd.Output()
106 if err != nil {
107 return "", fmt.Errorf("erro ao obter diferenças do arquivo %s: %w", filepath, err)
108 }
109 return string(output), nil
110}
111
112// Função auxiliar para obter o histórico de um arquivo específico
113func GetFileHistory(filepath string) (string, error) {

Callers

nothing calls this directly

Calls 2

ErrorfMethod · 0.80
OutputMethod · 0.65

Tested by

no test coverage detected