Follows #19266, #8553, Close#18553, now there are only three `Run..(&RunOpts{})` functions.
* before: `stdout, err := RunInDir(path)`
* now: `stdout, _, err := RunStdString(&git.RunOpts{Dir:path})`
logger.Warn("Unable to get merge base for PR ID %d, #%d onto %s in %s/%s. Error: %v & %v",pr.ID,pr.Index,pr.BaseBranch,pr.BaseRepo.OwnerName,pr.BaseRepo.Name,err,err2)
logger.Warn("Unable to get merge base for PR ID %d, #%d onto %s in %s/%s. Error: %v & %v",pr.ID,pr.Index,pr.BaseBranch,pr.BaseRepo.OwnerName,pr.BaseRepo.Name,err,err2)
logger.Warn("Unable to get parents for merged PR ID %d, #%d onto %s in %s/%s. Error: %v",pr.ID,pr.Index,pr.BaseBranch,pr.BaseRepo.OwnerName,pr.BaseRepo.Name,err)
logger.Warn("Unable to get parents for merged PR ID %d, #%d onto %s in %s/%s. Error: %v",pr.ID,pr.Index,pr.BaseBranch,pr.BaseRepo.OwnerName,pr.BaseRepo.Name,err)
logger.Warn("Unable to get merge base for merged PR ID %d, #%d onto %s in %s/%s. Error: %v",pr.ID,pr.Index,pr.BaseBranch,pr.BaseRepo.OwnerName,pr.BaseRepo.Name,err)
logger.Warn("Unable to get merge base for merged PR ID %d, #%d onto %s in %s/%s. Error: %v",pr.ID,pr.Index,pr.BaseBranch,pr.BaseRepo.OwnerName,pr.BaseRepo.Name,err)
return*(*string)(unsafe.Pointer(&b))// that's what Golang's strings.Builder.String() does (go/src/strings/builder.go)
return*(*string)(unsafe.Pointer(&b))// that's what Golang's strings.Builder.String() does (go/src/strings/builder.go)
}
}
// RunWithContextString run the command with context and returns stdout/stderr as string. and store stderr to returned error (err combined with stderr).
// RunStdString runs the command with options and returns stdout/stderr as string. and store stderr to returned error (err combined with stderr).
log.Error("git checkout base prior to merge post staging rebase [%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("git checkout base prior to merge post staging rebase [%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 checkout base prior to merge post staging rebase [%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 checkout base prior to merge post staging rebase [%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("git checkout base prior to merge post staging rebase [%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("git checkout base prior to merge post staging rebase [%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 checkout base prior to merge post staging rebase [%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 checkout base prior to merge post staging rebase [%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 fetch origin base branch [%s:%s -> base, original_base in %s]: %v:\n%s\n%s",pr.BaseRepo.FullName(),pr.BaseBranch,tmpBasePath,err,outbuf.String(),errbuf.String())
log.Error("Unable to fetch origin base branch [%s:%s -> base, original_base in %s]: %v:\n%s\n%s",pr.BaseRepo.FullName(),pr.BaseBranch,tmpBasePath,err,outbuf.String(),errbuf.String())
log.Error("Unable to run git ls-files for temporary repo: %s (%s) Error: %v\nstdout: %s\nstderr: %s",t.repo.FullName(),t.basePath,err,stdOut.String(),stdErr.String())
log.Error("Unable to run git ls-files for temporary repo: %s (%s) Error: %v\nstdout: %s\nstderr: %s",t.repo.FullName(),t.basePath,err,stdOut.String(),stdErr.String())
err=fmt.Errorf("Unable to run git ls-files for temporary repo of: %s Error: %v\nstdout: %s\nstderr: %s",t.repo.FullName(),err,stdOut.String(),stdErr.String())
err=fmt.Errorf("Unable to run git ls-files for temporary repo of: %s Error: %v\nstdout: %s\nstderr: %s",t.repo.FullName(),err,stdOut.String(),stdErr.String())
@ -144,12 +143,11 @@ func (t *TemporaryUploadRepository) RemoveFilesFromIndex(filenames ...string) er