Debian Codegraph @

commands/command_prune.go

raw symbols SCIP
1 package commandsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/
2
3 import (
4 "bytesscip-go gomod github.com/golang/go/src go1.25.0 bytes/"
5 "contextscip-go gomod github.com/golang/go/src go1.25.0 context/"
6 "fmtscip-go gomod github.com/golang/go/src go1.25.0 fmt/"
7 "osscip-go gomod github.com/golang/go/src go1.25.0 os/"
8 "runtimescip-go gomod github.com/golang/go/src go1.25.0 runtime/"
9 "syncscip-go gomod github.com/golang/go/src go1.25.0 sync/"
10 "timescip-go gomod github.com/golang/go/src go1.25.0 time/"
11
12 "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`/"
13 "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`/"
14 "github.com/git-lfs/git-lfs/v3/fsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/fs`/"
15 "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`/"
16 "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`/"
17 "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`/"
18 "github.com/git-lfs/git-lfs/v3/toolsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/"
19 "github.com/git-lfs/git-lfs/v3/tools/humanizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools/humanize`/"
20 "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`/"
21 "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`/"
22 "github.com/rubyist/tracerxscip-go gomod github.com/rubyist/tracerx 787959303086 `github.com/rubyist/tracerx`/"
23 "github.com/spf13/cobrascip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/"
24 "golang.org/x/sync/semaphorescip-go gomod golang.org/x/sync v0.22.0 `golang.org/x/sync/semaphore`/"
25 )
26
27 var (
28 pruneDryRunArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneDryRunArg. bool
29 pruneVerboseArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneVerboseArg. bool
30 pruneVerifyArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneVerifyArg. bool
31 pruneRecentArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneRecentArg. bool
32 pruneForceArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneForceArg. bool
33 pruneDoNotVerifyArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneDoNotVerifyArg. bool
34 pruneVerifyUnreachableArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneVerifyUnreachableArg. bool
35 pruneDoNotVerifyUnreachableArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneDoNotVerifyUnreachableArg. bool
36 pruneWhenUnverifiedArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneWhenUnverifiedArg. string
37 )
38
39 func pruneCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneCommand().(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) {
40 // Guts of this must be re-usable from fetch --prune so just parse & dispatch
41 if pruneVerifyArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneVerifyArg. && pruneDoNotVerifyArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneDoNotVerifyArg. {
42 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 specify both --verify-remote and --no-verify-remote"))
43 }
44
45 fetchPruneConfig := 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.)
46 verify := !pruneDoNotVerifyArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneDoNotVerifyArg. &&
47 (fetchPruneConfig.PruneVerifyRemoteAlwaysscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#PruneVerifyRemoteAlways. || pruneVerifyArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneVerifyArg.)
48 verifyUnreachable := !pruneDoNotVerifyUnreachableArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneDoNotVerifyUnreachableArg. && (pruneVerifyUnreachableArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneVerifyUnreachableArg. || fetchPruneConfig.PruneVerifyUnreachableAlwaysscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#PruneVerifyUnreachableAlways.)
49
50 continueWhenUnverified := false
51 switch pruneWhenUnverifiedArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneWhenUnverifiedArg. {
52 case "halt":
53 continueWhenUnverified = false
54 case "continue":
55 continueWhenUnverified = true
56 default:
57 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 value for --when-unverified: %s", pruneWhenUnverifiedArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneWhenUnverifiedArg.))
58 }
59
60 fetchPruneConfig.PruneRecentscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#PruneRecent. = pruneRecentArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneRecentArg. || pruneForceArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneForceArg.
61 fetchPruneConfig.PruneForcescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#PruneForce. = pruneForceArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneForceArg.
62 prunescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/prune().(fetchPruneConfig, verify, verifyUnreachable, continueWhenUnverified, pruneDryRunArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneDryRunArg., pruneVerboseArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneVerboseArg.)
63 }
64
65 type PruneProgressTypescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgressType# int
66
67 const (
68 PruneProgressTypeLocalscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgressTypeLocal. = PruneProgressTypescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgressType#(iota)
69 PruneProgressTypeRetainscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgressTypeRetain. = PruneProgressTypescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgressType#(iota)
70 PruneProgressTypeVerifyscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgressTypeVerify. = PruneProgressTypescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgressType#(iota)
71 PruneProgressTypeUnverifiedscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgressTypeUnverified. = PruneProgressTypescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgressType#(iota)
72 )
73
74 // Progress from a sub-task of prune
75 type PruneProgressscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgress# struct {
76 ProgressTypescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgress#ProgressType. PruneProgressTypescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgressType#
77 Countscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgress#Count. int // Number of items done
78 }
79 type PruneProgressChanscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgressChan# chan PruneProgressscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgress#
80
81 func prunescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/prune().(fetchPruneConfig 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#, verifyRemote, verifyUnreachable, continueWhenUnverified, dryRun, verbose bool) {
82 localObjects := make([]fsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/fs`/.Objectscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/fs`/Object#, 0, 100)
83 retainedObjects := toolsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/.NewStringSetWithCapacityscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/NewStringSetWithCapacity().(100)
84
85 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.,
86 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().()),
87 )
88 defer logger.Closescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/Logger#Close().()
89
90 var reachableObjects toolsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/.StringSetscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/StringSet#
91 var taskwait 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#
92
93 // Add all the base funcs to the waitgroup before starting them, in case
94 // one completes really fast & hits 0 unexpectedly
95 // each main process can Add() to the wg itself if it subdivides the task
96 taskwait.Addscip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Add().(5) // 1..5: localObjects, current & recent refs, unpushed, worktree, stashes
97 if verifyRemote && !verifyUnreachable {
98 taskwait.Addscip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Add().(1) // 6
99 }
100
101 progressChan := make(PruneProgressChanscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgressChan#, 100)
102
103 // Collect errors
104 errorChan := make(chan error, 10)
105 var errorwait 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#
106 errorwait.Addscip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Add().(1)
107 var taskErrors []error
108 go pruneTaskCollectErrorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneTaskCollectErrors().(&taskErrors, errorChan, &errorwait)
109
110 // Populate the single list of local objects
111 go pruneTaskGetLocalObjectsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneTaskGetLocalObjects().(&localObjects, progressChan, &taskwait)
112
113 // Now find files to be retained from many sources
114 retainChan := make(chan string, 100)
115
116 gitscanner := 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., nil)
117 gitscanner.Filterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/GitScanner#Filter. = filepathfilterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/.Newscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/New().(nil, 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().(), filepathfilterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/.GitIgnorescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/filepathfilter`/GitIgnore., 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.)
118
119 sem := semaphorescip-go gomod golang.org/x/sync v0.22.0 `golang.org/x/sync/semaphore`/.NewWeightedscip-go gomod golang.org/x/sync v0.22.0 `golang.org/x/sync/semaphore`/NewWeighted().(int64(runtimescip-go gomod github.com/golang/go/src go1.25.0 runtime/.NumCPUscip-go gomod github.com/golang/go/src go1.25.0 runtime/NumCPU().() * 2))
120
121 go pruneTaskGetRetainedCurrentAndRecentRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneTaskGetRetainedCurrentAndRecentRefs().(gitscanner, fetchPruneConfig, retainChan, errorChan, &taskwait, sem)
122 go pruneTaskGetRetainedUnpushedscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneTaskGetRetainedUnpushed().(gitscanner, fetchPruneConfig, retainChan, errorChan, &taskwait, sem)
123 go pruneTaskGetRetainedWorktreescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneTaskGetRetainedWorktree().(gitscanner, fetchPruneConfig, retainChan, errorChan, &taskwait, sem)
124 go pruneTaskGetRetainedStashedscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneTaskGetRetainedStashed().(gitscanner, retainChan, errorChan, &taskwait, sem)
125 if verifyRemote && !verifyUnreachable {
126 reachableObjects = toolsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/.NewStringSetWithCapacityscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/NewStringSetWithCapacity().(100)
127 go pruneTaskGetReachableObjectsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneTaskGetReachableObjects().(gitscanner, &reachableObjects, errorChan, &taskwait, sem)
128 }
129
130 // Now collect all the retained objects, on separate wait
131 var retainwait 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#
132 retainwait.Addscip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Add().(1)
133 go pruneTaskCollectRetainedscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneTaskCollectRetained().(&retainedObjects, retainChan, progressChan, &retainwait)
134
135 // Report progress
136 var progresswait 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#
137 progresswait.Addscip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Add().(1)
138 go pruneTaskDisplayProgressscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneTaskDisplayProgress().(progressChan, &progresswait, logger)
139
140 taskwait.Waitscip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Wait().() // wait for subtasks
141 close(retainChan) // triggers retain collector to end now all tasks have
142 retainwait.Waitscip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Wait().() // make sure all retained objects added
143
144 close(errorChan) // triggers error collector to end now all tasks have
145 errorwait.Waitscip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Wait().() // make sure all errors have been processed
146 pruneCheckErrorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneCheckErrors().(taskErrors)
147
148 prunableObjects := make([]string, 0, len(localObjects)/2)
149
150 // Build list of prunables (also queue for verify at same time if applicable)
151 var verifyQueue *tqscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/.TransferQueuescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/TransferQueue#
152 var verifiedObjects toolsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/.StringSetscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/StringSet#
153 var totalSize int64
154 var verboseOutput []string
155 var verifyc chan *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#
156 var verifywait 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#
157
158 if verifyRemote {
159 verifyQueue = newDownloadCheckQueuescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/newDownloadCheckQueue().(
160 getTransferManifestOperationRemotescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/getTransferManifestOperationRemote().("download", fetchPruneConfig.PruneRemoteNamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#PruneRemoteName.),
161 fetchPruneConfig.PruneRemoteNamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#PruneRemoteName.,
162 )
163 verifiedObjects = toolsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/.NewStringSetWithCapacityscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/NewStringSetWithCapacity().(len(localObjects) / 2)
164
165 // this channel is filled with oids for which Check() succeeded & Transfer() was called
166 verifyc = verifyQueue.Watchscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/TransferQueue#Watch().()
167 verifywait.Addscip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Add().(1)
168 go func() {
169 for t := range verifyc {
170 verifiedObjects.Addscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/StringSet#Add().(t.Oidscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/Transfer#Oid.)
171 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().("VERIFIED: %v", t.Oidscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/Transfer#Oid.)
172 progressChan <- PruneProgressscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgress#{PruneProgressTypeVerifyscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgressTypeVerify., 1}
173 }
174 verifywait.Donescip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Done().()
175 }()
176 }
177
178 for _, file := range localObjects {
179 if !retainedObjects.Containsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/StringSet#Contains().(file.Oidscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/fs`/Object#Oid.) {
180 prunableObjects = append(prunableObjects, file.Oidscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/fs`/Object#Oid.)
181 totalSize += file.Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/fs`/Object#Size.
182 if verbose {
183 // Save up verbose output for the end.
184 verboseOutput = append(verboseOutput,
185 fmtscip-go gomod github.com/golang/go/src go1.25.0 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.25.0 fmt/Sprintf().("%s (%s)",
186 file.Oidscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/fs`/Object#Oid.,
187 humanizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools/humanize`/.FormatBytesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools/humanize`/FormatBytes().(uint64(file.Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/fs`/Object#Size.))))
188 }
189
190 if verifyRemote {
191 verifyQueue.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().(&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#{
192 Pointerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/WrappedPointer#Pointer.: lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.NewPointerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/NewPointer().(file.Oidscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/fs`/Object#Oid., file.Sizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/fs`/Object#Size., nil),
193 }))
194 }
195 }
196 }
197
198 if verifyRemote {
199 verifyQueue.Waitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tq`/TransferQueue#Wait().()
200 verifywait.Waitscip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Wait().()
201
202 var problems bytesscip-go gomod github.com/golang/go/src go1.25.0 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.25.0 bytes/Buffer#
203 prunableObjectsLen := len(prunableObjects)
204 prunableObjects, problems = pruneGetVerifiedPrunableObjectsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneGetVerifiedPrunableObjects().(prunableObjects, reachableObjects, verifiedObjects, verifyUnreachable)
205 if prunableObjectsLen != len(prunableObjects) {
206 progressChan <- PruneProgressscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgress#{PruneProgressTypeUnverifiedscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgressTypeUnverified., prunableObjectsLen - len(prunableObjects)}
207 }
208
209 close(progressChan) // after verify but before check
210 progresswait.Waitscip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Wait().()
211
212 if !continueWhenUnverified && problems.Lenscip-go gomod github.com/golang/go/src go1.25.0 bytes/Buffer#Len().() > 0 {
213 Exitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/Exit().("%s\n%v", 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().("These objects to be pruned are missing on remote:"), problems.Stringscip-go gomod github.com/golang/go/src go1.25.0 bytes/Buffer#String().())
214 }
215 } else {
216 close(progressChan)
217 progresswait.Waitscip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Wait().()
218 }
219
220 if len(prunableObjects) == 0 {
221 return
222 }
223
224 logVerboseOutputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/logVerboseOutput().(logger, verboseOutput, len(prunableObjects), totalSize, dryRun)
225
226 if !dryRun {
227 pruneDeleteFilesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneDeleteFiles().(prunableObjects, logger)
228 }
229 }
230
231 func logVerboseOutputscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/logVerboseOutput().(logger *tasklogscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/.Loggerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/Logger#, verboseOutput []string, numPrunableObjects int, totalSize int64, dryRun bool) {
232 info := logger.Simplescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/Logger#Simple().()
233 defer info.Completescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/SimpleTask#Complete().()
234
235 if dryRun {
236 info.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().(
237 "%d file would be pruned (%s)",
238 "%d files would be pruned (%s)",
239 numPrunableObjects,
240 numPrunableObjects,
241 humanizescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools/humanize`/.FormatBytesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools/humanize`/FormatBytes().(uint64(totalSize))))
242 for _, item := range verboseOutput {
243 info.Logfscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/SimpleTask#Logf().("\n * %s", item)
244 }
245 } else {
246 for _, item := range verboseOutput {
247 info.Logfscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/SimpleTask#Logf().("\n%s", item)
248 }
249 }
250 }
251
252 func pruneGetVerifiedPrunableObjectsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneGetVerifiedPrunableObjects().(prunableObjects []string, reachableObjects, verifiedObjects toolsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/.StringSetscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/StringSet#, verifyUnreachable bool) ([]string, bytesscip-go gomod github.com/golang/go/src go1.25.0 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.25.0 bytes/Buffer#) {
253 verifiedPrunableObjects := make([]string, 0, len(verifiedObjects))
254 var unverified bytesscip-go gomod github.com/golang/go/src go1.25.0 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.25.0 bytes/Buffer#
255
256 for _, oid := range prunableObjects {
257 if verifiedObjects.Containsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/StringSet#Contains().(oid) {
258 verifiedPrunableObjects = append(verifiedPrunableObjects, oid)
259 } else {
260 if verifyUnreachable {
261 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().("UNVERIFIED: %v", oid)
262 unverified.WriteStringscip-go gomod github.com/golang/go/src go1.25.0 bytes/Buffer#WriteString().(fmtscip-go gomod github.com/golang/go/src go1.25.0 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.25.0 fmt/Sprintf().(" * %v\n", oid))
263 } else {
264 // There's no issue if an object is not reachable and missing, only if reachable & missing
265 if reachableObjects.Containsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/StringSet#Contains().(oid) {
266 unverified.WriteStringscip-go gomod github.com/golang/go/src go1.25.0 bytes/Buffer#WriteString().(fmtscip-go gomod github.com/golang/go/src go1.25.0 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.25.0 fmt/Sprintf().(" * %v\n", oid))
267 } else {
268 // Just to indicate why it doesn't matter that we didn't verify
269 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().("UNREACHABLE: %v", oid)
270 verifiedPrunableObjects = append(verifiedPrunableObjects, oid)
271 }
272 }
273 }
274 }
275
276 return verifiedPrunableObjects, unverified
277 }
278
279 func pruneCheckErrorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneCheckErrors().(taskErrors []error) {
280 if len(taskErrors) > 0 {
281 for _, err := range taskErrors {
282 LoggedErrorscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/LoggedError().(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().("Prune error: %v", err))
283 }
284 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().("Prune sub-tasks failed, cannot continue"))
285 }
286 }
287
288 func pruneTaskDisplayProgressscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneTaskDisplayProgress().(progressChan PruneProgressChanscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgressChan#, waitg *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#, logger *tasklogscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/.Loggerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/Logger#) {
289 defer waitg.Donescip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Done().()
290
291 task := logger.Simplescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/Logger#Simple().()
292 defer task.Completescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/SimpleTask#Complete().()
293
294 localCount := 0
295 retainCount := 0
296 verifyCount := 0
297 notRemoteCount := 0
298 var msg string
299 for p := range progressChan {
300 switch p.ProgressTypescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgress#ProgressType. {
301 case PruneProgressTypeLocalscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgressTypeLocal.:
302 localCount++
303 case PruneProgressTypeRetainscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgressTypeRetain.:
304 retainCount++
305 case PruneProgressTypeVerifyscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgressTypeVerify.:
306 verifyCount++
307 case PruneProgressTypeUnverifiedscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgressTypeUnverified.:
308 notRemoteCount += p.Countscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgress#Count.
309 }
310 msg = fmtscip-go gomod github.com/golang/go/src go1.25.0 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.25.0 fmt/Sprintf().("%s, %s",
311 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 local object", "%d local objects", localCount, localCount),
312 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 retained", "%d retained", retainCount, retainCount))
313 if verifyCount > 0 {
314 msg += 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 verified with remote", ", %d verified with remote", verifyCount, verifyCount)
315 }
316 if notRemoteCount > 0 {
317 msg += 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 not on remote", ", %d not on remote", notRemoteCount, notRemoteCount)
318 }
319 task.Logscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/SimpleTask#Log().(msg)
320 }
321 }
322
323 func pruneTaskCollectRetainedscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneTaskCollectRetained().(outRetainedObjects *toolsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/.StringSetscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/StringSet#, retainChan chan string,
324 progressChan PruneProgressChanscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgressChan#, retainwait *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#) {
325
326 defer retainwait.Donescip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Done().()
327
328 for oid := range retainChan {
329 if outRetainedObjects.Addscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/StringSet#Add().(oid) {
330 progressChan <- PruneProgressscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgress#{PruneProgressTypeRetainscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgressTypeRetain., 1}
331 }
332 }
333
334 }
335
336 func pruneTaskCollectErrorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneTaskCollectErrors().(outtaskErrors *[]error, errorChan chan error, errorwait *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#) {
337 defer errorwait.Donescip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Done().()
338
339 for err := range errorChan {
340 *outtaskErrors = append(*outtaskErrors, err)
341 }
342 }
343
344 func pruneDeleteFilesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneDeleteFiles().(prunableObjects []string, logger *tasklogscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/.Loggerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/Logger#) {
345 task := logger.Percentagescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/Logger#Percentage().(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().("Deleting objects"), uint64(len(prunableObjects)))
346 defer task.Completescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/PercentageTask#Complete().()
347
348 var problems bytesscip-go gomod github.com/golang/go/src go1.25.0 bytes/.Bufferscip-go gomod github.com/golang/go/src go1.25.0 bytes/Buffer#
349 // In case we fail to delete some
350 var deletedFiles int
351 for _, oid := range prunableObjects {
352 mediaFile, err := cfgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/cfg..Filesystemscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/Configuration#Filesystem().().ObjectPathscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/fs`/Filesystem#ObjectPath().(oid)
353 if err != nil {
354 problems.WriteStringscip-go gomod github.com/golang/go/src go1.25.0 bytes/Buffer#WriteString().(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().("Unable to find media path for %v: %v", oid, err))
355 problems.WriteRunescip-go gomod github.com/golang/go/src go1.25.0 bytes/Buffer#WriteRune().('\n')
356 continue
357 }
358 if mediaFile == osscip-go gomod github.com/golang/go/src go1.25.0 os/.DevNullscip-go gomod github.com/golang/go/src go1.25.0 os/DevNull. {
359 continue
360 }
361 err = osscip-go gomod github.com/golang/go/src go1.25.0 os/.Removescip-go gomod github.com/golang/go/src go1.25.0 os/Remove().(mediaFile)
362 if err != nil {
363 problems.WriteStringscip-go gomod github.com/golang/go/src go1.25.0 bytes/Buffer#WriteString().(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().("Failed to remove file %v: %v", mediaFile, err))
364 problems.WriteRunescip-go gomod github.com/golang/go/src go1.25.0 bytes/Buffer#WriteRune().('\n')
365 continue
366 }
367 deletedFiles++
368 task.Countscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tasklog`/PercentageTask#Count().(1)
369 }
370 if problems.Lenscip-go gomod github.com/golang/go/src go1.25.0 bytes/Buffer#Len().() > 0 {
371 LoggedErrorscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/LoggedError().(errorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/.Newscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/New().(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().("failed to delete some files")), problems.Stringscip-go gomod github.com/golang/go/src go1.25.0 bytes/Buffer#String().())
372 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().("Prune failed, see errors above"))
373 }
374 }
375
376 // Background task, must call waitg.Done() once at end
377 func pruneTaskGetLocalObjectsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneTaskGetLocalObjects().(outLocalObjects *[]fsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/fs`/.Objectscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/fs`/Object#, progChan PruneProgressChanscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgressChan#, waitg *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#) {
378 defer waitg.Donescip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Done().()
379
380 cfgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/cfg..EachLFSObjectscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/Configuration#EachLFSObject().(func(obj fsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/fs`/.Objectscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/fs`/Object#) error {
381 *outLocalObjects = append(*outLocalObjects, obj)
382 progChan <- PruneProgressscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgress#{PruneProgressTypeLocalscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/PruneProgressTypeLocal., 1}
383 return nil
384 })
385 }
386
387 // Background task, must call waitg.Done() once at end
388 func pruneTaskGetRetainedAtRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneTaskGetRetainedAtRef().(gitscanner *lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.GitScannerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/GitScanner#, ref string, retainChan chan string, errorChan chan error, waitg *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#, sem *semaphorescip-go gomod golang.org/x/sync v0.22.0 `golang.org/x/sync/semaphore`/.Weightedscip-go gomod golang.org/x/sync v0.22.0 `golang.org/x/sync/semaphore`/Weighted#) {
389 sem.Acquirescip-go gomod golang.org/x/sync v0.22.0 `golang.org/x/sync/semaphore`/Weighted#Acquire().(contextscip-go gomod github.com/golang/go/src go1.25.0 context/.Backgroundscip-go gomod github.com/golang/go/src go1.25.0 context/Background().(), 1)
390 defer sem.Releasescip-go gomod golang.org/x/sync v0.22.0 `golang.org/x/sync/semaphore`/Weighted#Release().(1)
391 defer waitg.Donescip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Done().()
392
393 err := gitscanner.ScanTreescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/GitScanner#ScanTree().(ref, 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) {
394 if err != nil {
395 errorChan <- err
396 return
397 }
398
399 retainChan <- p.Oidscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/Pointer#Oid.
400 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().("RETAIN: %v via ref %v", p.Oidscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/Pointer#Oid., ref)
401 })
402
403 if err != nil {
404 errorChan <- err
405 }
406 }
407
408 // Background task, must call waitg.Done() once at end
409 func pruneTaskGetPreviousVersionsOfRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneTaskGetPreviousVersionsOfRef().(gitscanner *lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.GitScannerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/GitScanner#, 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#, retainChan chan string, errorChan chan error, waitg *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#, sem *semaphorescip-go gomod golang.org/x/sync v0.22.0 `golang.org/x/sync/semaphore`/.Weightedscip-go gomod golang.org/x/sync v0.22.0 `golang.org/x/sync/semaphore`/Weighted#) {
410 sem.Acquirescip-go gomod golang.org/x/sync v0.22.0 `golang.org/x/sync/semaphore`/Weighted#Acquire().(contextscip-go gomod github.com/golang/go/src go1.25.0 context/.Backgroundscip-go gomod github.com/golang/go/src go1.25.0 context/Background().(), 1)
411 defer sem.Releasescip-go gomod golang.org/x/sync v0.22.0 `golang.org/x/sync/semaphore`/Weighted#Release().(1)
412 defer waitg.Donescip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Done().()
413
414 err := gitscanner.ScanPreviousVersionsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/GitScanner#ScanPreviousVersions().(ref, since, 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) {
415 if err != nil {
416 errorChan <- err
417 return
418 }
419
420 retainChan <- p.Oidscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/Pointer#Oid.
421 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().("RETAIN: %v via ref %v >= %v", p.Oidscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/Pointer#Oid., ref, since)
422 })
423
424 if err != nil {
425 errorChan <- err
426 return
427 }
428 }
429
430 // Background task, must call waitg.Done() once at end
431 func pruneTaskGetRetainedCurrentAndRecentRefsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneTaskGetRetainedCurrentAndRecentRefs().(gitscanner *lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.GitScannerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/GitScanner#, 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#, retainChan chan string, errorChan chan error, waitg *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#, sem *semaphorescip-go gomod golang.org/x/sync v0.22.0 `golang.org/x/sync/semaphore`/.Weightedscip-go gomod golang.org/x/sync v0.22.0 `golang.org/x/sync/semaphore`/Weighted#) {
432 defer waitg.Donescip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Done().()
433
434 // We actually increment the waitg in this func since we kick off sub-goroutines
435 // Make a list of what unique commits to keep, & search backward from
436 commits := toolsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/.NewStringSetscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/NewStringSet().()
437 // Do current first
438 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().()
439 if err != nil {
440 errorChan <- err
441 return
442 }
443 commits.Addscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/StringSet#Add().(ref.Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.)
444 if !fetchconf.PruneForcescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#PruneForce. {
445 waitg.Addscip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Add().(1)
446 go pruneTaskGetRetainedAtRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneTaskGetRetainedAtRef().(gitscanner, ref.Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha., retainChan, errorChan, waitg, sem)
447 }
448
449 // Now recent
450 if !fetchconf.PruneRecentscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#PruneRecent. && fetchconf.FetchRecentRefsDaysscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#FetchRecentRefsDays. > 0 {
451 pruneRefDays := fetchconf.FetchRecentRefsDaysscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#FetchRecentRefsDays. + fetchconf.PruneOffsetDaysscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#PruneOffsetDays.
452 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().("PRUNE: Retaining non-HEAD refs within %d (%d+%d) days", pruneRefDays, fetchconf.FetchRecentRefsDaysscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#FetchRecentRefsDays., fetchconf.PruneOffsetDaysscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#PruneOffsetDays.)
453 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, -pruneRefDays)
454 // Keep all recent refs including any recent remote branches
455 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., "")
456 if err != nil {
457 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"))
458 }
459 for _, ref := range refs {
460 if commits.Addscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/StringSet#Add().(ref.Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.) {
461 // A new commit
462 waitg.Addscip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Add().(1)
463 go pruneTaskGetRetainedAtRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneTaskGetRetainedAtRef().(gitscanner, ref.Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha., retainChan, errorChan, waitg, sem)
464 }
465 }
466 }
467
468 // For every unique commit we've fetched, check recent commits too
469 // Only if we're fetching recent commits, otherwise only keep at refs
470 if !fetchconf.PruneRecentscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#PruneRecent. && fetchconf.FetchRecentCommitsDaysscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#FetchRecentCommitsDays. > 0 {
471 pruneCommitDays := fetchconf.FetchRecentCommitsDaysscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#FetchRecentCommitsDays. + fetchconf.PruneOffsetDaysscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#PruneOffsetDays.
472 for commit := range commits.Iterscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/StringSet#Iter().() {
473 // We measure from the last commit at the ref
474 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)
475 if err != nil {
476 errorChan <- errorsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/.Newscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/errors`/New().(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", commit, err))
477 continue
478 }
479 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, -pruneCommitDays)
480 waitg.Addscip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Add().(1)
481 go pruneTaskGetPreviousVersionsOfRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneTaskGetPreviousVersionsOfRef().(gitscanner, commit, commitsSince, retainChan, errorChan, waitg, sem)
482 }
483 }
484 }
485
486 // Background task, must call waitg.Done() once at end
487 func pruneTaskGetRetainedUnpushedscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneTaskGetRetainedUnpushed().(gitscanner *lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.GitScannerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/GitScanner#, 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#, retainChan chan string, errorChan chan error, waitg *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#, sem *semaphorescip-go gomod golang.org/x/sync v0.22.0 `golang.org/x/sync/semaphore`/.Weightedscip-go gomod golang.org/x/sync v0.22.0 `golang.org/x/sync/semaphore`/Weighted#) {
488 defer waitg.Donescip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Done().()
489
490 err := gitscanner.ScanUnpushedscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/GitScanner#ScanUnpushed().(fetchconf.PruneRemoteNamescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#PruneRemoteName., 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) {
491 if err != nil {
492 errorChan <- err
493 } else {
494 retainChan <- p.Pointerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/WrappedPointer#Pointer..Oidscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/Pointer#Oid.
495 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().("RETAIN: %v unpushed", p.Pointerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/WrappedPointer#Pointer..Oidscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/Pointer#Oid.)
496 }
497 })
498
499 if err != nil {
500 errorChan <- err
501 return
502 }
503 }
504
505 // Background task, must call waitg.Done() once at end
506 func pruneTaskGetRetainedWorktreescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneTaskGetRetainedWorktree().(gitscanner *lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.GitScannerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/GitScanner#, 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#, retainChan chan string, errorChan chan error, waitg *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#, sem *semaphorescip-go gomod golang.org/x/sync v0.22.0 `golang.org/x/sync/semaphore`/.Weightedscip-go gomod golang.org/x/sync v0.22.0 `golang.org/x/sync/semaphore`/Weighted#) {
507 defer waitg.Donescip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Done().()
508
509 // Retain other worktree HEADs too
510 // Working copy, branch & maybe commit is different but repo is shared
511 allWorktrees, err := gitscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/.GetAllWorktreesscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/GetAllWorktrees().(cfgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/cfg..LocalGitStorageDirscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/config`/Configuration#LocalGitStorageDir().())
512 if err != nil {
513 errorChan <- err
514 return
515 }
516 // Don't repeat any commits, worktrees are always on their own branches but
517 // may point to the same commit
518 commits := toolsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/.NewStringSetscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/NewStringSet().()
519
520 if !fetchconf.PruneForcescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#PruneForce. {
521 // current HEAD is done elsewhere
522 headref, 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().()
523 if err != nil {
524 errorChan <- err
525 return
526 }
527
528 commits.Addscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/StringSet#Add().(headref.Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.)
529 }
530
531 for _, worktree := range allWorktrees {
532 if !fetchconf.PruneForcescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/FetchPruneConfig#PruneForce. && commits.Addscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/StringSet#Add().(worktree.Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Worktree#Ref..Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha.) {
533 // Worktree is on a different commit
534 waitg.Addscip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Add().(1)
535 // Don't need to 'cd' to worktree since we share same repo
536 go pruneTaskGetRetainedAtRefscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneTaskGetRetainedAtRef().(gitscanner, worktree.Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Worktree#Ref..Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha., retainChan, errorChan, waitg, sem)
537 }
538
539 if !worktree.Prunablescip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Worktree#Prunable. {
540 // Always scan the index of the worktree if it exists
541 waitg.Addscip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Add().(1)
542 go pruneTaskGetRetainedIndexscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneTaskGetRetainedIndex().(gitscanner, worktree.Refscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Worktree#Ref..Shascip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Ref#Sha., worktree.Dirscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/git`/Worktree#Dir., retainChan, errorChan, waitg, sem)
543 }
544 }
545 }
546
547 // Background task, must call waitg.Done() once at end
548 func pruneTaskGetRetainedStashedscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneTaskGetRetainedStashed().(gitscanner *lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.GitScannerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/GitScanner#, retainChan chan string, errorChan chan error, waitg *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#, sem *semaphorescip-go gomod golang.org/x/sync v0.22.0 `golang.org/x/sync/semaphore`/.Weightedscip-go gomod golang.org/x/sync v0.22.0 `golang.org/x/sync/semaphore`/Weighted#) {
549 defer waitg.Donescip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Done().()
550
551 err := gitscanner.ScanStashedscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/GitScanner#ScanStashed().(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) {
552 if err != nil {
553 errorChan <- err
554 } else {
555 retainChan <- p.Pointerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/WrappedPointer#Pointer..Oidscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/Pointer#Oid.
556 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().("RETAIN: %v stashed", p.Pointerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/WrappedPointer#Pointer..Oidscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/Pointer#Oid.)
557 }
558 })
559
560 if err != nil {
561 errorChan <- err
562 return
563 }
564 }
565
566 // Background task, must call waitg.Done() once at end
567 func pruneTaskGetRetainedIndexscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneTaskGetRetainedIndex().(gitscanner *lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.GitScannerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/GitScanner#, ref string, workingDir string, retainChan chan string, errorChan chan error, waitg *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#, sem *semaphorescip-go gomod golang.org/x/sync v0.22.0 `golang.org/x/sync/semaphore`/.Weightedscip-go gomod golang.org/x/sync v0.22.0 `golang.org/x/sync/semaphore`/Weighted#) {
568 defer waitg.Donescip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Done().()
569
570 err := gitscanner.ScanIndexscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/GitScanner#ScanIndex().(ref, workingDir, 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) {
571 if err != nil {
572 errorChan <- err
573 } else {
574 retainChan <- p.Pointerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/WrappedPointer#Pointer..Oidscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/Pointer#Oid.
575 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().("RETAIN: %v index", p.Pointerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/WrappedPointer#Pointer..Oidscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/Pointer#Oid.)
576 }
577 })
578
579 if err != nil {
580 errorChan <- err
581 return
582 }
583 }
584
585 // Background task, must call waitg.Done() once at end
586 func pruneTaskGetReachableObjectsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneTaskGetReachableObjects().(gitscanner *lfsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/.GitScannerscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/GitScanner#, outObjectSet *toolsscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/.StringSetscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/StringSet#, errorChan chan error, waitg *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#, sem *semaphorescip-go gomod golang.org/x/sync v0.22.0 `golang.org/x/sync/semaphore`/.Weightedscip-go gomod golang.org/x/sync v0.22.0 `golang.org/x/sync/semaphore`/Weighted#) {
587 defer waitg.Donescip-go gomod github.com/golang/go/src go1.25.0 sync/WaitGroup#Done().()
588
589 err := gitscanner.ScanAllscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/GitScanner#ScanAll().(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) {
590 sem.Acquirescip-go gomod golang.org/x/sync v0.22.0 `golang.org/x/sync/semaphore`/Weighted#Acquire().(contextscip-go gomod github.com/golang/go/src go1.25.0 context/.Backgroundscip-go gomod github.com/golang/go/src go1.25.0 context/Background().(), 1)
591 defer sem.Releasescip-go gomod golang.org/x/sync v0.22.0 `golang.org/x/sync/semaphore`/Weighted#Release().(1)
592
593 if err != nil {
594 errorChan <- err
595 return
596 }
597 outObjectSet.Addscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/tools`/StringSet#Add().(p.Oidscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/lfs`/Pointer#Oid.)
598 })
599
600 if err != nil {
601 errorChan <- err
602 }
603 }
604
605 func initscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/init().() {
606 RegisterCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/RegisterCommand().("prune", pruneCommandscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneCommand()., 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#) {
607 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().(&pruneDryRunArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneDryRunArg., "dry-run", "d", false, "Don't delete anything, just report")
608 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().(&pruneVerboseArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneVerboseArg., "verbose", "v", false, "Print full details of what is/would be deleted")
609 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().(&pruneRecentArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneRecentArg., "recent", "", false, "Prune even recent objects")
610 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().(&pruneForceArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneForceArg., "force", "f", false, "Prune everything that has been pushed")
611 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().(&pruneVerifyArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneVerifyArg., "verify-remote", "c", false, "Verify that remote has reachable LFS files before deleting")
612 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().(&pruneDoNotVerifyArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneDoNotVerifyArg., "no-verify-remote", false, "Override lfs.pruneverifyremotealways and don't verify")
613 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().(&pruneVerifyUnreachableArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneVerifyUnreachableArg., "verify-unreachable", false, "When using --verify-remote, additionally verify unreachable LFS files before deleting.")
614 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().(&pruneDoNotVerifyUnreachableArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneDoNotVerifyUnreachableArg., "no-verify-unreachable", false, "Override lfs.pruneverifyunreachablealways and don't verify unreachable objects")
615 cmd.Flagsscip-go gomod github.com/spf13/cobra v1.10.2 `github.com/spf13/cobra`/Command#Flags().().StringVarscip-go gomod github.com/spf13/pflag v1.0.9 `github.com/spf13/pflag`/FlagSet#StringVar().(&pruneWhenUnverifiedArgscip-go gomod github.com/git-lfs/git-lfs/v3 . `github.com/git-lfs/git-lfs/v3/commands`/pruneWhenUnverifiedArg., "when-unverified", "halt", "halt|continue the execution when objects are not found on the remote")
616 })
617 }