MCPcopy Create free account
hub / github.com/celer-pkg/celer / CheckIfRemoteTag

Function CheckIfRemoteTag

pkgs/git/remote.go:30–38  ·  view source on GitHub ↗

CheckIfRemoteTag check if repoRef is a tag.

(target, repoUrl, repoRef string)

Source from the content-addressed store, hash-verified

28
29// CheckIfRemoteTag check if repoRef is a tag.
30func CheckIfRemoteTag(target, repoUrl, repoRef string) (bool, error) {
31 title := fmt.Sprintf("[query remote tag: %s]", target)
32 output, err := cmd.NewExecutor(title, "git", "ls-remote", "--tags", repoUrl, repoRef).
33 WithRetry(retryMaxAttempts).ExecuteOutput()
34 if err != nil {
35 return false, fmt.Errorf("failed to query remote tag %s of %s -> %w", repoRef, repoUrl, err)
36 }
37 return strings.TrimSpace(output) != "", nil
38}
39
40// GetRemoteHeadCommit resolves the HEAD commit of a remote repository.
41func GetRemoteHeadCommit(target, repoUrl string) (string, error) {

Callers 3

GetRemoteRefCommitFunction · 0.85
CloneRepoFunction · 0.85
UpdateRepoFunction · 0.85

Calls 4

NewExecutorFunction · 0.92
SprintfMethod · 0.80
ExecuteOutputMethod · 0.80
WithRetryMethod · 0.80

Tested by

no test coverage detected