(cmd *cobra.Command, args []string)
| 147 | } |
| 148 | |
| 149 | func 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 | |
| 171 | func smudgeFilename(args []string) string { |
| 172 | if len(args) > 0 { |
nothing calls this directly
no test coverage detected