Fix rebase conflict detection in git 2.26 (#10929)
* Fix rebase conflict detection in git 2.26
Git changed the technique used in rebase from
simple apply-patches to use merge. This breaks
our conflict detection code.
Signed-off-by: Andrew Thornton <art27@cantab.net>
* As per @techknowlogick reduce copying
Signed-off-by: Andrew Thornton <art27@cantab.net>
log.Error("git rebase staging on to base [%s:%s -> %s:%s]: %v\n%s\n%s",pr.HeadRepo.FullName(),pr.HeadBranch,pr.BaseRepo.FullName(),pr.BaseBranch,err,outbuf.String(),errbuf.String())
return"",fmt.Errorf("git rebase staging on to base [%s:%s -> %s:%s]: %v\n%s\n%s",pr.HeadRepo.FullName(),pr.HeadBranch,pr.BaseRepo.FullName(),pr.BaseBranch,err,outbuf.String(),errbuf.String())
log.Error("Unable to determine failing commit sha for this rebase message. Cannot cast as models.ErrRebaseConflicts.")
log.Error("git rebase staging on to base [%s:%s -> %s:%s]: %v\n%s\n%s",pr.HeadRepo.FullName(),pr.HeadBranch,pr.BaseRepo.FullName(),pr.BaseBranch,err,outbuf.String(),errbuf.String())
return"",fmt.Errorf("git rebase staging on to base [%s:%s -> %s:%s]: %v\n%s\n%s",pr.HeadRepo.FullName(),pr.HeadBranch,pr.BaseRepo.FullName(),pr.BaseBranch,err,outbuf.String(),errbuf.String())
}
log.Debug("RebaseConflict at %s [%s:%s -> %s:%s]: %v\n%s\n%s",strings.TrimSpace(string(commitShaBytes)),pr.HeadRepo.FullName(),pr.HeadBranch,pr.BaseRepo.FullName(),pr.BaseBranch,err,outbuf.String(),errbuf.String())
log.Debug("RebaseConflict at %s [%s:%s -> %s:%s]: %v\n%s\n%s",commitSha,pr.HeadRepo.FullName(),pr.HeadBranch,pr.BaseRepo.FullName(),pr.BaseBranch,err,outbuf.String(),errbuf.String())