(oid string)
| 782 | |
| 783 | func 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 | |
| 792 | func 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 | |
| 798 | func (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 | }) |
no outgoing calls
no test coverage detected