This commit is contained in:
Nanguan Lin 2024-05-04 09:36:58 +03:00 committed by GitHub
commit 62cae7cf78
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -272,6 +272,10 @@ func CutDiffAroundLine(originalDiff io.Reader, line int64, old bool, numbersOfLi
// GetAffectedFiles returns the affected files between two commits
func GetAffectedFiles(repo *Repository, oldCommitID, newCommitID string, env []string) ([]string, error) {
// If the old commit is the null commit, then we need to use the empty tree
if oldCommitID == EmptySHA {
oldCommitID = EmptyTreeSHA
}
stdoutReader, stdoutWriter, err := os.Pipe()
if err != nil {
log.Error("Unable to create os.Pipe for %s", repo.Path)