[GIT] fix output for getting single commit without parents (#1060)

pull/3484/head
Johannes Batzill 2024-02-21 22:17:06 +00:00 committed by Harness
parent aae15eb5a5
commit 1d74fcde4c
1 changed files with 4 additions and 1 deletions

View File

@ -616,7 +616,10 @@ func GetCommit(
}
sha := commitData[0]
parentSHAs := strings.Split(commitData[1], " ")
var parentSHAs []string
if commitData[1] != "" {
parentSHAs = strings.Split(commitData[1], " ")
}
authorName := commitData[2]
authorEmail := commitData[3]
authorTimestamp := commitData[4]