ephemeral := true
currentBranches, err := repo.ListBranches(ctx, storage.ListBranchesOptions{
Ephemeral: &ephemeral,
Limit: 100,
})
for _, attemptBranch := range attemptBranches {
var headSHA string
for _, current := range currentBranches.Branches {
if current.Name == attemptBranch {
headSHA = current.HeadSHA
break
}
}
if headSHA == "" {
panic(fmt.Sprintf("no branch exists for %s", attemptBranch))
}
diff, err := repo.GetCommitDiff(ctx, storage.GetCommitDiffOptions{
BaseSHA: baseSHA,
SHA: headSHA,
})
fmt.Println(attemptBranch, diff.Stats)
}