Prepend Git config instructions to disable Git LFS filter
(args ...string)
| 179 | |
| 180 | // Prepend Git config instructions to disable Git LFS filter |
| 181 | func gitConfigNoLFS(args ...string) []string { |
| 182 | // Before git 2.8, setting filters to blank causes lots of warnings, so use cat instead (slightly slower) |
| 183 | // Also pre 2.2 it failed completely. We used to use it anyway in git 2.2-2.7 and |
| 184 | // suppress the messages in stderr, but doing that with standard StderrPipe suppresses |
| 185 | // the git clone output (git thinks it's not a terminal) and makes it look like it's |
| 186 | // not working. You can get around that with https://github.com/kr/pty but that |
| 187 | // causes difficult issues with passing through Stdin for login prompts |
| 188 | // This way is simpler & more practical. |
| 189 | filterOverride := "" |
| 190 | if !IsGitVersionAtLeast("2.8.0") { |
| 191 | filterOverride = "cat" |
| 192 | } |
| 193 | |
| 194 | return append([]string{ |
| 195 | "-c", fmt.Sprintf("filter.lfs.smudge=%v", filterOverride), |
| 196 | "-c", fmt.Sprintf("filter.lfs.clean=%v", filterOverride), |
| 197 | "-c", "filter.lfs.process=", |
| 198 | "-c", "filter.lfs.required=false", |
| 199 | }, args...) |
| 200 | } |
| 201 | |
| 202 | // Invoke Git with disabled LFS filters |
| 203 | func gitNoLFS(args ...string) (*subprocess.Cmd, error) { |
no test coverage detected