Função auxiliar para obter o histórico de um arquivo específico
(filepath string)
| 111 | |
| 112 | // Função auxiliar para obter o histórico de um arquivo específico |
| 113 | func GetFileHistory(filepath string) (string, error) { |
| 114 | cmd := exec.Command("git", "log", "--follow", "--pretty=format:%h - %an, %ar : %s", "--", filepath) //#nosec G204 -- agent/CLI tool execution; commands validated by command_validator + policy_manager upstream |
| 115 | output, err := cmd.Output() |
| 116 | if err != nil { |
| 117 | return "", fmt.Errorf("erro ao obter histórico do arquivo %s: %w", filepath, err) |
| 118 | } |
| 119 | return string(output), nil |
| 120 | } |
| 121 | |
| 122 | // Função auxiliar para obter blame de um arquivo |
| 123 | func GetFileBlame(filepath string) (string, error) { |