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

Function pruneCommand

commands/command_prune.go:39–63  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

37)
38
39func pruneCommand(cmd *cobra.Command, args []string) {
40 // Guts of this must be re-usable from fetch --prune so just parse & dispatch
41 if pruneVerifyArg && pruneDoNotVerifyArg {
42 Exit(tr.Tr.Get("Cannot specify both --verify-remote and --no-verify-remote"))
43 }
44
45 fetchPruneConfig := lfs.NewFetchPruneConfig(cfg.Git)
46 verify := !pruneDoNotVerifyArg &&
47 (fetchPruneConfig.PruneVerifyRemoteAlways || pruneVerifyArg)
48 verifyUnreachable := !pruneDoNotVerifyUnreachableArg && (pruneVerifyUnreachableArg || fetchPruneConfig.PruneVerifyUnreachableAlways)
49
50 continueWhenUnverified := false
51 switch pruneWhenUnverifiedArg {
52 case "halt":
53 continueWhenUnverified = false
54 case "continue":
55 continueWhenUnverified = true
56 default:
57 Exit(tr.Tr.Get("Invalid value for --when-unverified: %s", pruneWhenUnverifiedArg))
58 }
59
60 fetchPruneConfig.PruneRecent = pruneRecentArg || pruneForceArg
61 fetchPruneConfig.PruneForce = pruneForceArg
62 prune(fetchPruneConfig, verify, verifyUnreachable, continueWhenUnverified, pruneDryRunArg, pruneVerboseArg)
63}
64
65type PruneProgressType int
66

Callers

nothing calls this directly

Calls 4

NewFetchPruneConfigFunction · 0.92
ExitFunction · 0.85
pruneFunction · 0.85
GetMethod · 0.65

Tested by

no test coverage detected