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

Function smudgeCommand

commands/command_smudge.go:149–169  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

147}
148
149func smudgeCommand(cmd *cobra.Command, args []string) {
150 requireStdin(tr.Tr.Get("This command should be run by the Git 'smudge' filter"))
151 setupRepository()
152 installHooks(false)
153
154 if !smudgeSkip && cfg.Os.Bool("GIT_LFS_SKIP_SMUDGE", false) {
155 smudgeSkip = true
156 }
157 filter := filepathfilter.New(cfg.FetchIncludePaths(), cfg.FetchExcludePaths(), filepathfilter.GitIgnore)
158 gitfilter := lfs.NewGitFilter(cfg)
159
160 if n, err := smudge(gitfilter, os.Stdout, os.Stdin, smudgeFilename(args), smudgeSkip, filter); err != nil {
161 if errors.IsNotAPointerError(err) {
162 fmt.Fprintln(os.Stderr, err.Error())
163 } else {
164 Error(err.Error())
165 }
166 } else if possiblyMalformedObjectSize(n) {
167 fmt.Fprintln(os.Stderr, tr.Tr.Get("Possibly malformed smudge on Windows: see `git lfs help smudge` for more info."))
168 }
169}
170
171func smudgeFilename(args []string) string {
172 if len(args) > 0 {

Callers

nothing calls this directly

Calls 15

NewFunction · 0.92
NewGitFilterFunction · 0.92
IsNotAPointerErrorFunction · 0.92
requireStdinFunction · 0.85
setupRepositoryFunction · 0.85
installHooksFunction · 0.85
smudgeFunction · 0.85
smudgeFilenameFunction · 0.85
ErrorFunction · 0.85
FetchIncludePathsMethod · 0.80
FetchExcludePathsMethod · 0.80

Tested by

no test coverage detected