MCPcopy Create free account
hub / github.com/bufbuild/buf / getGitMetadataLabelsUploadOptions

Function getGitMetadataLabelsUploadOptions

cmd/buf/internal/command/push/push.go:536–550  ·  view source on GitHub ↗
(
	ctx context.Context,
	envContainer app.EnvContainer,
	input string,
	gitCommitSha string,
)

Source from the content-addressed store, hash-verified

534}
535
536func getGitMetadataLabelsUploadOptions(
537 ctx context.Context,
538 envContainer app.EnvContainer,
539 input string,
540 gitCommitSha string,
541) (bufmodule.UploadOption, error) {
542 refs, err := git.GetRefsForGitCommitAndRemote(ctx, envContainer, input, gitOriginRemote, gitCommitSha)
543 if err != nil {
544 return nil, err
545 }
546 if len(refs) == 0 {
547 return nil, fmt.Errorf("no tags or branches found for HEAD, %s", gitCommitSha)
548 }
549 return bufmodule.UploadWithLabels(refs...), nil
550}
551
552func getLabelUploadOption(flags *flags) bufmodule.UploadOption {
553 // We do not allow the mixing of flags, so post-validation, we only expect one of the

Callers 1

Calls 2

UploadWithLabelsFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…