MCPcopy
hub / github.com/git-lfs/git-lfs / pruneTaskDisplayProgress

Function pruneTaskDisplayProgress

commands/command_prune.go:288–321  ·  view source on GitHub ↗
(progressChan PruneProgressChan, waitg *sync.WaitGroup, logger *tasklog.Logger)

Source from the content-addressed store, hash-verified

286}
287
288func pruneTaskDisplayProgress(progressChan PruneProgressChan, waitg *sync.WaitGroup, logger *tasklog.Logger) {
289 defer waitg.Done()
290
291 task := logger.Simple()
292 defer task.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.ProgressType {
301 case PruneProgressTypeLocal:
302 localCount++
303 case PruneProgressTypeRetain:
304 retainCount++
305 case PruneProgressTypeVerify:
306 verifyCount++
307 case PruneProgressTypeUnverified:
308 notRemoteCount += p.Count
309 }
310 msg = fmt.Sprintf("%s, %s",
311 tr.Tr.GetN("%d local object", "%d local objects", localCount, localCount),
312 tr.Tr.GetN("%d retained", "%d retained", retainCount, retainCount))
313 if verifyCount > 0 {
314 msg += tr.Tr.GetN(", %d verified with remote", ", %d verified with remote", verifyCount, verifyCount)
315 }
316 if notRemoteCount > 0 {
317 msg += tr.Tr.GetN(", %d not on remote", ", %d not on remote", notRemoteCount, notRemoteCount)
318 }
319 task.Log(msg)
320 }
321}
322
323func pruneTaskCollectRetained(outRetainedObjects *tools.StringSet, retainChan chan string,
324 progressChan PruneProgressChan, retainwait *sync.WaitGroup) {

Callers 1

pruneFunction · 0.85

Calls 4

SimpleMethod · 0.80
LogMethod · 0.80
DoneMethod · 0.45
CompleteMethod · 0.45

Tested by

no test coverage detected