| 1 | package commandsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/ |
| 2 | |
| 3 | import ( |
| 4 | "bufioscip-go gomod github.com/golang/go/src go1.25.0 bufio/" |
| 5 | "encoding/jsonscip-go gomod github.com/golang/go/src go1.25.0 `encoding/json`/" |
| 6 | "osscip-go gomod github.com/golang/go/src go1.25.0 os/" |
| 7 | "syncscip-go gomod github.com/golang/go/src go1.25.0 sync/" |
| 8 | "timescip-go gomod github.com/golang/go/src go1.25.0 time/" |
| 9 | |
| 10 | "github.com/git-lfs/git-lfs/v3/errorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/" |
| 11 | "github.com/git-lfs/git-lfs/v3/filepathfilterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/" |
| 12 | "github.com/git-lfs/git-lfs/v3/gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/" |
| 13 | "github.com/git-lfs/git-lfs/v3/lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/" |
| 14 | "github.com/git-lfs/git-lfs/v3/tasklogscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/" |
| 15 | "github.com/git-lfs/git-lfs/v3/tqscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/" |
| 16 | "github.com/git-lfs/git-lfs/v3/trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/" |
| 17 | "github.com/rubyist/tracerxscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/" |
| 18 | "github.com/spf13/cobrascip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/" |
| 19 | ) |
| 20 | |
| 21 | var ( |
| 22 | fetchRecentArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchRecentArg. bool |
| 23 | fetchAllArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchAllArg. bool |
| 24 | fetchPruneArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchPruneArg. bool |
| 25 | fetchRefetchArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchRefetchArg. bool |
| 26 | fetchDryRunArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchDryRunArg. bool |
| 27 | fetchJsonArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchJsonArg. bool |
| 28 | fetchUseStdinscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchUseStdin. bool |
| 29 | ) |
| 30 | |
| 31 | type fetchWatcherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchWatcher# struct { |
| 32 | transfersscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchWatcher#transfers. []*tqscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/.Transferscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/Transfer# |
| 33 | observedscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchWatcher#observed. map[string]bool |
| 34 | } |
| 35 | |
| 36 | func (d *fetchWatcherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchWatcher#) registerTransferscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchWatcher#registerTransfer().(t *tqscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/.Transferscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/Transfer#) { |
| 37 | if fetchJsonArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchJsonArg. { |
| 38 | d.transfersscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchWatcher#transfers. = append(d.transfersscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchWatcher#transfers., t) |
| 39 | } |
| 40 | if fetchDryRunArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchDryRunArg. || fetchRefetchArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchRefetchArg. { |
| 41 | if d.observedscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchWatcher#observed. == nil { |
| 42 | d.observedscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchWatcher#observed. = make(map[string]bool) |
| 43 | } |
| 44 | d.observedscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchWatcher#observed.[t.Oidscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/Transfer#Oid.] = true |
| 45 | } |
| 46 | if fetchDryRunArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchDryRunArg. { |
| 47 | printProgressscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/printProgress().("%s %s => %s", trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("fetch"), t.Oidscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/Transfer#Oid., t.Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/Transfer#Name.) |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | func (d *fetchWatcherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchWatcher#) dumpJsonscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchWatcher#dumpJson().() { |
| 52 | data := struct { |
| 53 | Transfers []*tqscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/.Transferscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/Transfer# `json:"transfers"` |
| 54 | }{Transfers: d.transfersscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchWatcher#transfers.} |
| 55 | if data.Transfers == nil { |
| 56 | data.Transfers = []*tqscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/.Transferscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/Transfer#{} |
| 57 | } |
| 58 | encoder := jsonscip-go gomod github.com/golang/go/src go1.25.0 `encoding/json`/.NewEncoderscip-go gomod github.com/golang/go/src go1.25.0 `encoding/json`/NewEncoder().(osscip-go gomod github.com/golang/go/src go1.25.0 os/.Stdoutscip-go gomod github.com/golang/go/src go1.25.0 os/Stdout.) |
| 59 | encoder.SetIndentscip-go gomod github.com/golang/go/src go1.25.0 `encoding/json`/Encoder#SetIndent().("", " ") |
| 60 | if err := encoder.Encodescip-go gomod github.com/golang/go/src go1.25.0 `encoding/json`/Encoder#Encode().(data); err != nil { |
| 61 | ExitWithErrorscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/ExitWithError().(err) |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | func (d *fetchWatcherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchWatcher#) hasObservedscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchWatcher#hasObserved().(oid string) bool { |
| 66 | return d.observedscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchWatcher#observed.[oid] |
| 67 | } |
| 68 | |
| 69 | func hasToPrintTransfersscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/hasToPrintTransfers().() bool { |
| 70 | return fetchJsonArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchJsonArg. || fetchDryRunArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchDryRunArg. |
| 71 | } |
| 72 | |
| 73 | func printProgressscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/printProgress().(format string, args ...interface{}) { |
| 74 | // TODO: Adjust all our commands to use a common function to output |
| 75 | // progress messages to stderr, following Git's model. |
| 76 | Errorscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/Error().(format, args...) |
| 77 | } |
| 78 | |
| 79 | func getIncludeExcludeArgsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/getIncludeExcludeArgs().(cmd *cobrascip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/.Commandscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#) (include, exclude *string) { |
| 80 | includeFlag := cmd.Flagscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#Flag().("include") |
| 81 | excludeFlag := cmd.Flagscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#Flag().("exclude") |
| 82 | if includeFlag.Changedscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/Flag#Changed. { |
| 83 | include = &includeArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/includeArg. |
| 84 | } |
| 85 | if excludeFlag.Changedscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/Flag#Changed. { |
| 86 | exclude = &excludeArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/excludeArg. |
| 87 | } |
| 88 | |
| 89 | return |
| 90 | } |
| 91 | |
| 92 | func fetchCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchCommand().(cmd *cobrascip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/.Commandscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#, args []string) { |
| 93 | setupRepositoryscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/setupRepository().() |
| 94 | |
| 95 | var refs []*gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref# |
| 96 | |
| 97 | if len(args) > 0 { |
| 98 | // Remote is first arg |
| 99 | if err := cfgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/cfg..SetValidRemotescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/Configuration#SetValidRemote().(args[0]); err != nil { |
| 100 | Exitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/Exit().(trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Invalid remote name %q: %s", args[0], err)) |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | if fetchUseStdinscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchUseStdin. { |
| 105 | if len(args) > 1 { |
| 106 | Exitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/Exit().(trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Further command line arguments are ignored with --stdin")) |
| 107 | } |
| 108 | |
| 109 | scanner := bufioscip-go gomod github.com/golang/go/src go1.25.0 bufio/.NewScannerscip-go gomod github.com/golang/go/src go1.25.0 bufio/NewScanner().(osscip-go gomod github.com/golang/go/src go1.25.0 os/.Stdinscip-go gomod github.com/golang/go/src go1.25.0 os/Stdin.) // line-delimited |
| 110 | for scanner.Scanscip-go gomod github.com/golang/go/src go1.25.0 bufio/Scanner#Scan().() { |
| 111 | line := scanner.Textscip-go gomod github.com/golang/go/src go1.25.0 bufio/Scanner#Text().() |
| 112 | if line != "" { |
| 113 | ref, err := gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.ResolveRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/ResolveRef().(line) |
| 114 | if err != nil { |
| 115 | Panicscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/Panic().(err, trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Invalid ref argument: %v", line)) |
| 116 | } |
| 117 | refs = append(refs, ref) |
| 118 | } |
| 119 | } |
| 120 | if err := scanner.Errscip-go gomod github.com/golang/go/src go1.25.0 bufio/Scanner#Err().(); err != nil { |
| 121 | ExitWithErrorscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/ExitWithError().(errorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/.Wrapscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/Wrap().(err, trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Error reading from stdin:"))) |
| 122 | } |
| 123 | } else if len(args) > 1 { |
| 124 | resolvedrefs, err := gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.ResolveRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/ResolveRefs().(args[1:]) |
| 125 | if err != nil { |
| 126 | Panicscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/Panic().(err, trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Invalid ref argument: %v", args[1:])) |
| 127 | } |
| 128 | refs = resolvedrefs |
| 129 | } else if !fetchAllArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchAllArg. { |
| 130 | ref, err := gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.CurrentRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/CurrentRef().() |
| 131 | if err != nil { |
| 132 | Panicscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/Panic().(err, trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Could not fetch")) |
| 133 | } |
| 134 | refs = []*gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#{ref} |
| 135 | } |
| 136 | |
| 137 | if fetchJsonArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchJsonArg. && fetchPruneArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchPruneArg. { |
| 138 | // git lfs prune has no `--json` flag, so let's not allow that here for the moment |
| 139 | Exitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/Exit().(trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Cannot combine --json with --prune")) |
| 140 | } |
| 141 | |
| 142 | success := true |
| 143 | include, exclude := getIncludeExcludeArgsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/getIncludeExcludeArgs().(cmd) |
| 144 | fetchPruneCfg := lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.NewFetchPruneConfigscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/NewFetchPruneConfig().(cfgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/cfg..Gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/Configuration#Git.) |
| 145 | |
| 146 | watcher := &fetchWatcherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchWatcher#{} |
| 147 | |
| 148 | if fetchAllArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchAllArg. { |
| 149 | if fetchRecentArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchRecentArg. { |
| 150 | Exitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/Exit().(trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Cannot combine --all with --recent")) |
| 151 | } |
| 152 | if include != nil || exclude != nil { |
| 153 | Exitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/Exit().(trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Cannot combine --all with --include or --exclude")) |
| 154 | } |
| 155 | if len(cfgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/cfg..FetchIncludePathsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/Configuration#FetchIncludePaths().()) > 0 || len(cfgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/cfg..FetchExcludePathsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/Configuration#FetchExcludePaths().()) > 0 { |
| 156 | printProgressscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/printProgress().(trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Ignoring global include / exclude paths to fulfil --all")) |
| 157 | } |
| 158 | |
| 159 | if len(refs) > 0 { |
| 160 | refShas := make([]string, 0, len(refs)) |
| 161 | for _, ref := range refs { |
| 162 | refShas = append(refShas, ref.Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.) |
| 163 | } |
| 164 | success = fetchRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchRefs().(refShas, watcher) |
| 165 | } else { |
| 166 | success = fetchAllscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchAll().(watcher) |
| 167 | } |
| 168 | |
| 169 | } else { // !all |
| 170 | filter := buildFilepathFilterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/buildFilepathFilter().(cfgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/cfg., include, exclude, true) |
| 171 | |
| 172 | // Fetch refs sequentially per arg order; duplicates in later refs will be ignored |
| 173 | for _, ref := range refs { |
| 174 | printProgressscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/printProgress().(trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Fetching reference %s", ref.Refspecscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Refspec().())) |
| 175 | s := fetchRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchRef().(ref.Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha., filter, watcher) |
| 176 | success = success && s |
| 177 | } |
| 178 | |
| 179 | if fetchRecentArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchRecentArg. || fetchPruneCfg.FetchRecentAlwaysscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#FetchRecentAlways. { |
| 180 | s := fetchRecentscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchRecent().(fetchPruneCfg, refs, filter, watcher) |
| 181 | success = success && s |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | if fetchPruneArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchPruneArg. { |
| 186 | verify := fetchPruneCfg.PruneVerifyRemoteAlwaysscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#PruneVerifyRemoteAlways. |
| 187 | verifyUnreachable := fetchPruneCfg.PruneVerifyUnreachableAlwaysscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#PruneVerifyUnreachableAlways. |
| 188 | |
| 189 | // assume false for non available options in fetch |
| 190 | prunescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/prune().(fetchPruneCfg, verify, verifyUnreachable, false, fetchDryRunArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchDryRunArg., fetchDryRunArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchDryRunArg.) |
| 191 | } |
| 192 | |
| 193 | if !success { |
| 194 | c := getAPIClientscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/getAPIClient().() |
| 195 | e := c.Endpointsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/Client#Endpoints..Endpointscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfsapi`/EndpointFinder#Endpoint.("download", cfgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/cfg..Remotescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/Configuration#Remote().()) |
| 196 | Exitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/Exit().(trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("error: failed to fetch some objects from '%s'", e.Urlscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfshttp`/Endpoint#Url.)) |
| 197 | } |
| 198 | if fetchJsonArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchJsonArg. { |
| 199 | watcher.dumpJsonscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchWatcher#dumpJson().() |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | func pointersToFetchForRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pointersToFetchForRef().(ref string, filter *filepathfilterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/.Filterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#) ([]*lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.WrappedPointerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/WrappedPointer#, error) { |
| 204 | var pointers []*lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.WrappedPointerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/WrappedPointer# |
| 205 | var multiErr error |
| 206 | tempgitscanner := lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.NewGitScannerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/NewGitScanner().(cfgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/cfg., func(p *lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.WrappedPointerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/WrappedPointer#, err error) { |
| 207 | if err != nil { |
| 208 | multiErr = errorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/.Joinscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/Join().(multiErr, err) |
| 209 | return |
| 210 | } |
| 211 | |
| 212 | pointers = append(pointers, p) |
| 213 | }) |
| 214 | |
| 215 | tempgitscanner.Filterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/GitScanner#Filter. = filter |
| 216 | |
| 217 | if err := tempgitscanner.ScanTreescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/GitScanner#ScanTree().(ref, nil); err != nil { |
| 218 | return nil, err |
| 219 | } |
| 220 | |
| 221 | return pointers, multiErr |
| 222 | } |
| 223 | |
| 224 | // Fetch all binaries for a given ref (that we don't have already) |
| 225 | func fetchRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchRef().(ref string, filter *filepathfilterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/.Filterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#, watcher *fetchWatcherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchWatcher#) bool { |
| 226 | pointers, err := pointersToFetchForRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pointersToFetchForRef().(ref, filter) |
| 227 | if err != nil { |
| 228 | Panicscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/Panic().(err, trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Could not scan for Git LFS files")) |
| 229 | } |
| 230 | return fetchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetch().(pointers, watcher) |
| 231 | } |
| 232 | |
| 233 | func pointersToFetchForRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pointersToFetchForRefs().(refs []string) ([]*lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.WrappedPointerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/WrappedPointer#, error) { |
| 234 | // This could be a long process so use the chan version & report progress |
| 235 | logger := tasklogscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/.NewLoggerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/NewLogger().(OutputWriterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/OutputWriter., |
| 236 | tasklogscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/.ForceProgressscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/ForceProgress().(cfgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/cfg..ForceProgressscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/Configuration#ForceProgress().()), |
| 237 | ) |
| 238 | task := logger.Simplescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/Logger#Simple().() |
| 239 | defer task.Completescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/SimpleTask#Complete().() |
| 240 | |
| 241 | // use temp gitscanner to collect pointers |
| 242 | var pointers []*lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.WrappedPointerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/WrappedPointer# |
| 243 | var multiErr error |
| 244 | var numObjs int64 |
| 245 | tempgitscanner := lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.NewGitScannerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/NewGitScanner().(cfgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/cfg., func(p *lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.WrappedPointerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/WrappedPointer#, err error) { |
| 246 | if err != nil { |
| 247 | multiErr = errorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/.Joinscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/Join().(multiErr, err) |
| 248 | return |
| 249 | } |
| 250 | |
| 251 | numObjs++ |
| 252 | task.Logscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/SimpleTask#Log().(trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..GetNscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#GetN().("%d object found", "%d objects found", int(numObjs), numObjs)) |
| 253 | pointers = append(pointers, p) |
| 254 | }) |
| 255 | |
| 256 | if err := tempgitscanner.ScanRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/GitScanner#ScanRefs().(refs, nil, nil); err != nil { |
| 257 | return nil, err |
| 258 | } |
| 259 | |
| 260 | return pointers, multiErr |
| 261 | } |
| 262 | |
| 263 | func fetchRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchRefs().(refs []string, watcher *fetchWatcherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchWatcher#) bool { |
| 264 | pointers, err := pointersToFetchForRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pointersToFetchForRefs().(refs) |
| 265 | if err != nil { |
| 266 | Panicscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/Panic().(err, trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Could not scan for Git LFS files")) |
| 267 | } |
| 268 | return fetchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetch().(pointers, watcher) |
| 269 | } |
| 270 | |
| 271 | // Fetch all previous versions of objects from since to ref (not including final state at ref) |
| 272 | // So this will fetch all the '-' sides of the diff from since to ref |
| 273 | func fetchPreviousVersionsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchPreviousVersions().(ref string, since timescip-go gomod github.com/golang/go/src go1.25.0 time/.Timescip-go gomod github.com/golang/go/src go1.25.0 time/Time#, filter *filepathfilterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/.Filterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#, watcher *fetchWatcherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchWatcher#) bool { |
| 274 | var pointers []*lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.WrappedPointerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/WrappedPointer# |
| 275 | |
| 276 | tempgitscanner := lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.NewGitScannerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/NewGitScanner().(cfgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/cfg., func(p *lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.WrappedPointerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/WrappedPointer#, err error) { |
| 277 | if err != nil { |
| 278 | Panicscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/Panic().(err, trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Could not scan for Git LFS previous versions")) |
| 279 | return |
| 280 | } |
| 281 | |
| 282 | pointers = append(pointers, p) |
| 283 | }) |
| 284 | |
| 285 | tempgitscanner.Filterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/GitScanner#Filter. = filter |
| 286 | |
| 287 | if err := tempgitscanner.ScanPreviousVersionsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/GitScanner#ScanPreviousVersions().(ref, since, nil); err != nil { |
| 288 | ExitWithErrorscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/ExitWithError().(err) |
| 289 | } |
| 290 | |
| 291 | return fetchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetch().(pointers, watcher) |
| 292 | } |
| 293 | |
| 294 | // Fetch recent objects based on config |
| 295 | func fetchRecentscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchRecent().(fetchconf lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.FetchPruneConfigscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#, alreadyFetchedRefs []*gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#, filter *filepathfilterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/.Filterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/Filter#, watcher *fetchWatcherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchWatcher#) bool { |
| 296 | if fetchconf.FetchRecentRefsDaysscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#FetchRecentRefsDays. == 0 && fetchconf.FetchRecentCommitsDaysscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#FetchRecentCommitsDays. == 0 { |
| 297 | return true |
| 298 | } |
| 299 | |
| 300 | ok := true |
| 301 | // Make a list of what unique commits we've already fetched for to avoid duplicating work |
| 302 | uniqueRefShas := make(map[string]string, len(alreadyFetchedRefs)) |
| 303 | for _, ref := range alreadyFetchedRefs { |
| 304 | uniqueRefShas[ref.Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.] = ref.Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name. |
| 305 | } |
| 306 | // First find any other recent refs |
| 307 | if fetchconf.FetchRecentRefsDaysscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#FetchRecentRefsDays. > 0 { |
| 308 | printProgressscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/printProgress().(trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..GetNscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#GetN().( |
| 309 | "Fetching recent branches within %v day", |
| 310 | "Fetching recent branches within %v days", |
| 311 | fetchconf.FetchRecentRefsDaysscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#FetchRecentRefsDays., |
| 312 | fetchconf.FetchRecentRefsDaysscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#FetchRecentRefsDays., |
| 313 | )) |
| 314 | refsSince := timescip-go gomod github.com/golang/go/src go1.25.0 time/.Nowscip-go gomod github.com/golang/go/src go1.25.0 time/Now().().AddDatescip-go gomod github.com/golang/go/src go1.25.0 time/Time#AddDate().(0, 0, -fetchconf.FetchRecentRefsDaysscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#FetchRecentRefsDays.) |
| 315 | refs, err := gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.RecentBranchesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/RecentBranches().(refsSince, fetchconf.FetchRecentRefsIncludeRemotesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#FetchRecentRefsIncludeRemotes., cfgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/cfg..Remotescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/Configuration#Remote().()) |
| 316 | if err != nil { |
| 317 | Panicscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/Panic().(err, trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Could not scan for recent refs")) |
| 318 | } |
| 319 | for _, ref := range refs { |
| 320 | // Don't fetch for the same SHA twice |
| 321 | if prevRefName, ok := uniqueRefShas[ref.Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.]; ok { |
| 322 | if ref.Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name. != prevRefName { |
| 323 | tracerxscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/.Printfscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/Printf().("Skipping fetch for %v, already fetched via %v", ref.Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name., prevRefName) |
| 324 | } |
| 325 | } else { |
| 326 | uniqueRefShas[ref.Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.] = ref.Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name. |
| 327 | printProgressscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/printProgress().(trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Fetching reference %s", ref.Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Name.)) |
| 328 | k := fetchRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchRef().(ref.Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha., filter, watcher) |
| 329 | ok = ok && k |
| 330 | } |
| 331 | } |
| 332 | } |
| 333 | // For every unique commit we've fetched, check recent commits too |
| 334 | if fetchconf.FetchRecentCommitsDaysscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#FetchRecentCommitsDays. > 0 { |
| 335 | for commit, refName := range uniqueRefShas { |
| 336 | // We measure from the last commit at the ref |
| 337 | summ, err := gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.GetCommitSummaryscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/GetCommitSummary().(commit) |
| 338 | if err != nil { |
| 339 | Errorscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/Error().(trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Couldn't scan commits at %v: %v", refName, err)) |
| 340 | continue |
| 341 | } |
| 342 | printProgressscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/printProgress().(trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..GetNscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#GetN().( |
| 343 | "Fetching changes within %v day of %v", |
| 344 | "Fetching changes within %v days of %v", |
| 345 | fetchconf.FetchRecentCommitsDaysscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#FetchRecentCommitsDays., |
| 346 | fetchconf.FetchRecentCommitsDaysscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#FetchRecentCommitsDays., |
| 347 | refName, |
| 348 | )) |
| 349 | commitsSince := summ.CommitDatescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/CommitSummary#CommitDate..AddDatescip-go gomod github.com/golang/go/src go1.25.0 time/Time#AddDate().(0, 0, -fetchconf.FetchRecentCommitsDaysscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#FetchRecentCommitsDays.) |
| 350 | k := fetchPreviousVersionsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchPreviousVersions().(commit, commitsSince, filter, watcher) |
| 351 | ok = ok && k |
| 352 | } |
| 353 | |
| 354 | } |
| 355 | return ok |
| 356 | } |
| 357 | |
| 358 | func fetchAllscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchAll().(watcher *fetchWatcherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchWatcher#) bool { |
| 359 | pointers := scanAllscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/scanAll().() |
| 360 | printProgressscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/printProgress().(trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Fetching all references...")) |
| 361 | return fetchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetch().(pointers, watcher) |
| 362 | } |
| 363 | |
| 364 | func scanAllscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/scanAll().() []*lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.WrappedPointerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/WrappedPointer# { |
| 365 | // This could be a long process so use the chan version & report progress |
| 366 | logger := tasklogscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/.NewLoggerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/NewLogger().(OutputWriterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/OutputWriter., |
| 367 | tasklogscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/.ForceProgressscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/ForceProgress().(cfgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/cfg..ForceProgressscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/Configuration#ForceProgress().()), |
| 368 | ) |
| 369 | task := logger.Simplescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/Logger#Simple().() |
| 370 | defer task.Completescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/SimpleTask#Complete().() |
| 371 | |
| 372 | // use temp gitscanner to collect pointers |
| 373 | var pointers []*lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.WrappedPointerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/WrappedPointer# |
| 374 | var multiErr error |
| 375 | var numObjs int64 |
| 376 | tempgitscanner := lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.NewGitScannerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/NewGitScanner().(cfgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/cfg., func(p *lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.WrappedPointerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/WrappedPointer#, err error) { |
| 377 | if err != nil { |
| 378 | multiErr = errorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/.Joinscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/Join().(multiErr, err) |
| 379 | return |
| 380 | } |
| 381 | |
| 382 | numObjs++ |
| 383 | task.Logscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/SimpleTask#Log().(trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..GetNscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#GetN().("%d object found", "%d objects found", int(numObjs), numObjs)) |
| 384 | pointers = append(pointers, p) |
| 385 | }) |
| 386 | |
| 387 | if err := tempgitscanner.ScanAllscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/GitScanner#ScanAll().(nil); err != nil { |
| 388 | Panicscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/Panic().(err, trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Could not scan for Git LFS files")) |
| 389 | } |
| 390 | |
| 391 | if multiErr != nil { |
| 392 | Panicscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/Panic().(multiErr, trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/.Trscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tr`/Tr..Getscip-go gomod github.com/leonelquinteros/gotext v1.7.2 `github.com/leonelquinteros/gotext`/Locale#Get().("Could not scan for Git LFS files")) |
| 393 | } |
| 394 | |
| 395 | return pointers |
| 396 | } |
| 397 | |
| 398 | // Fetch |
| 399 | // Returns true if all completed with no errors, false if errors were written to stderr/log |
| 400 | func fetchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetch().(allPointers []*lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.WrappedPointerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/WrappedPointer#, watcher *fetchWatcherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchWatcher#) bool { |
| 401 | pointersToFetch, meter := pointersToFetchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pointersToFetch().(allPointers, watcher) |
| 402 | q := newDownloadQueuescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/newDownloadQueue().( |
| 403 | getTransferManifestOperationRemotescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/getTransferManifestOperationRemote().("download", cfgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/cfg..Remotescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/Configuration#Remote().()), |
| 404 | cfgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/cfg..Remotescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/Configuration#Remote().(), tqscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/.WithProgressscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/WithProgress().(meter), tqscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/.DryRunscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/DryRun().(fetchDryRunArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchDryRunArg.), |
| 405 | ) |
| 406 | var wg syncscip-go gomod github.com/golang/go/src go1.25.0 sync/.WaitGroupscip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup# |
| 407 | |
| 408 | if watcher != nil { |
| 409 | transfers := q.Watchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/TransferQueue#Watch().() |
| 410 | wg.Addscip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Add().(1) |
| 411 | go func() { |
| 412 | defer wg.Donescip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Done().() |
| 413 | for t := range transfers { |
| 414 | watcher.registerTransferscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchWatcher#registerTransfer().(t) |
| 415 | } |
| 416 | }() |
| 417 | } |
| 418 | |
| 419 | for _, p := range pointersToFetch { |
| 420 | tracerxscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/.Printfscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/Printf().("fetch %v [%v]", p.Namescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/WrappedPointer#Name., p.Oidscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/Pointer#Oid.) |
| 421 | |
| 422 | q.Addscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/TransferQueue#Add().(downloadTransferscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/downloadTransfer().(p)) |
| 423 | } |
| 424 | |
| 425 | processQueue := timescip-go gomod github.com/golang/go/src go1.25.0 time/.Nowscip-go gomod github.com/golang/go/src go1.25.0 time/Now().() |
| 426 | q.Waitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/TransferQueue#Wait().() |
| 427 | tracerxscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/.PerformanceSincescip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/PerformanceSince().("process queue", processQueue) |
| 428 | |
| 429 | ok := true |
| 430 | for _, err := range q.Errorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/TransferQueue#Errors().() { |
| 431 | ok = false |
| 432 | FullErrorscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/FullError().(err) |
| 433 | } |
| 434 | if watcher != nil { |
| 435 | wg.Waitscip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Wait().() |
| 436 | } |
| 437 | return ok |
| 438 | } |
| 439 | |
| 440 | func pointersToFetchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pointersToFetch().(allPointers []*lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.WrappedPointerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/WrappedPointer#, watcher *fetchWatcherscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchWatcher#) ([]*lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.WrappedPointerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/WrappedPointer#, *tqscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/.Meterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/Meter#) { |
| 441 | logger := tasklogscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/.NewLoggerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/NewLogger().(osscip-go gomod github.com/golang/go/src go1.25.0 os/.Stdoutscip-go gomod github.com/golang/go/src go1.25.0 os/Stdout., |
| 442 | tasklogscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/.ForceProgressscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/ForceProgress().(cfgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/cfg..ForceProgressscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/Configuration#ForceProgress().()), |
| 443 | ) |
| 444 | meter := buildProgressMeterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/buildProgressMeter().(hasToPrintTransfersscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/hasToPrintTransfers().(), tqscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/.Downloadscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/Download.) |
| 445 | logger.Enqueuescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/Logger#Enqueue().(meter) |
| 446 | |
| 447 | pointersToFetch := make([]*lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.WrappedPointerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/WrappedPointer#, 0, len(allPointers)) |
| 448 | |
| 449 | for _, p := range allPointers { |
| 450 | // if running with --dry-run or --refetch, skip objects that have already been virtually or |
| 451 | // already forcefully fetched |
| 452 | if watcher != nil && watcher.hasObservedscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchWatcher#hasObserved().(p.Oidscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/Pointer#Oid.) { |
| 453 | continue |
| 454 | } |
| 455 | |
| 456 | // empty files are special, we always skip them in upload/download operations |
| 457 | if p.Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/Pointer#Size. == 0 { |
| 458 | continue |
| 459 | } |
| 460 | |
| 461 | // no need to download objects that exist locally already, unless `--refetch` was provided |
| 462 | lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.LinkOrCopyFromReferencescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/LinkOrCopyFromReference().(cfgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/cfg., p.Oidscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/Pointer#Oid., p.Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/Pointer#Size.) |
| 463 | if !fetchRefetchArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchRefetchArg. && cfgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/cfg..LFSObjectExistsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/Configuration#LFSObjectExists().(p.Oidscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/Pointer#Oid., p.Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/Pointer#Size.) { |
| 464 | continue |
| 465 | } |
| 466 | |
| 467 | pointersToFetch = append(pointersToFetch, p) |
| 468 | meter.Addscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/Meter#Add().(p.Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/Pointer#Size.) |
| 469 | } |
| 470 | |
| 471 | return pointersToFetch, meter |
| 472 | } |
| 473 | |
| 474 | func initscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/init().() { |
| 475 | RegisterCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/RegisterCommand().("fetch", fetchCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchCommand()., func(cmd *cobrascip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/.Commandscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#) { |
| 476 | cmd.Flagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#Flags().().StringVarPscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#StringVarP().(&includeArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/includeArg., "include", "I", "", "Include a list of paths") |
| 477 | cmd.Flagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#Flags().().StringVarPscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#StringVarP().(&excludeArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/excludeArg., "exclude", "X", "", "Exclude a list of paths") |
| 478 | cmd.Flagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#Flags().().BoolVarPscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#BoolVarP().(&fetchRecentArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchRecentArg., "recent", "r", false, "Fetch recent refs & commits") |
| 479 | cmd.Flagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#Flags().().BoolVarPscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#BoolVarP().(&fetchAllArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchAllArg., "all", "a", false, "Fetch all LFS files ever referenced") |
| 480 | cmd.Flagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#Flags().().BoolVarPscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#BoolVarP().(&fetchPruneArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchPruneArg., "prune", "p", false, "After fetching, prune old data") |
| 481 | cmd.Flagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#Flags().().BoolVarscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#BoolVar().(&fetchRefetchArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchRefetchArg., "refetch", false, "Also fetch objects that are already present locally") |
| 482 | cmd.Flagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#Flags().().BoolVarPscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#BoolVarP().(&fetchDryRunArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchDryRunArg., "dry-run", "d", false, "Do not fetch, only show what would be fetched") |
| 483 | cmd.Flagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#Flags().().BoolVarPscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#BoolVarP().(&fetchJsonArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchJsonArg., "json", "j", false, "Give the output in a stable JSON format for scripts") |
| 484 | cmd.Flagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#Flags().().BoolVarPscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#BoolVarP().(&fetchUseStdinscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/fetchUseStdin., "stdin", "", false, "Read refs from stdin") |
| 485 | }) |
| 486 | } |