From 68fb0aea3b80523d0c37ed8c41683344d7936221 Mon Sep 17 00:00:00 2001 From: Taylor Blau Date: Mon, 31 Jul 2017 13:04:59 -0600 Subject: [PATCH] commands: use 'possiblyMalformedSmudge' helper instead of importing runtime --- commands/command_filter_process.go | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/commands/command_filter_process.go b/commands/command_filter_process.go index 502d6727..a622aaad 100644 --- a/commands/command_filter_process.go +++ b/commands/command_filter_process.go @@ -4,13 +4,11 @@ import ( "fmt" "io" "os" - "runtime" "github.com/git-lfs/git-lfs/errors" "github.com/git-lfs/git-lfs/filepathfilter" "github.com/git-lfs/git-lfs/git" "github.com/git-lfs/git-lfs/lfs" - "github.com/git-lfs/git-lfs/tools/humanize" "github.com/spf13/cobra" ) @@ -74,7 +72,7 @@ func filterCommand(cmd *cobra.Command, args []string) { if errors.IsNotAPointerError(err) { malformed = append(malformed, req.Header["pathname"]) err = nil - } else if n > 4*humanize.Gigabyte { + } else if possiblyMalformedSmudge(n) { malformedOnWindows = append(malformedOnWindows, req.Header["pathname"]) } @@ -96,15 +94,13 @@ func filterCommand(cmd *cobra.Command, args []string) { } if len(malformedOnWindows) > 0 { - if runtime.GOOS == "windows" { - fmt.Fprintf(os.Stderr, "Encountered %d file(s) that may not have been copied correctly on Windows:\n") + fmt.Fprintf(os.Stderr, "Encountered %d file(s) that may not have been copied correctly on Windows:\n") - for _, m := range malformedOnWindows { - fmt.Fprintf(os.Stderr, "\t%s\n", m) - } - - fmt.Fprintf(os.Stderr, "\nSee: `git lfs help smudge` for more details.\n") + for _, m := range malformedOnWindows { + fmt.Fprintf(os.Stderr, "\t%s\n", m) } + + fmt.Fprintf(os.Stderr, "\nSee: `git lfs help smudge` for more details.\n") } if err := s.Err(); err != nil && err != io.EOF {