MCPcopy Create free account
hub / github.com/cloudflare/artifact-fs / readObjectSize

Method readObjectSize

internal/gitstore/gitstore.go:784–806  ·  view source on GitHub ↗
(oid string)

Source from the content-addressed store, hash-verified

782
783func containsGitSymptom(message string, symptoms []string) bool {
784 for _, symptom := range symptoms {
785 if strings.Contains(message, symptom) {
786 return true
787 }
788 }
789 return false
790}
791
792func isTransientGitMessage(message string) bool {
793 message = strings.ToLower(message)
794 // Generic index-pack summaries can follow local failures that retrying cannot repair.
795 return !containsGitSymptom(message, permanentGitFailureSymptoms) && containsGitSymptom(message, transientGitFailureSymptoms)
796}
797
798func (s *Store) Fetch(ctx context.Context, repo model.RepoConfig) error {
799 remotesForLogging, cancelLookup := s.startRemotesForLogging(ctx, repo)
800 defer cancelLookup()
801 return s.retryGitOperationForRemoteLookup(ctx, GitOperationFetch, repo.Name, remotesForLogging, func() error {
802 args := []string{"fetch", "--no-tags"}
803 if repo.HistoryDepth > 0 {
804 args = append(args, fmt.Sprintf("--depth=%d", repo.HistoryDepth))
805 }
806 args = append(args, "origin")
807 _, err := runGit(ctx, repo.GitDir, args...)
808 return err
809 })

Callers 2

fetchToFileMethod · 0.95
readBlobMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected