prepareForDiff removes metadata such as .git and Kptfile from a staged package to exclude them from diffing.
(dir string)
| 304 | // prepareForDiff removes metadata such as .git and Kptfile from a staged package |
| 305 | // to exclude them from diffing. |
| 306 | func (d *defaultPkgDiffer) prepareForDiff(dir string) error { |
| 307 | excludePaths := []string{".git", kptfile.KptFileName} |
| 308 | for _, path := range excludePaths { |
| 309 | path = filepath.Join(dir, path) |
| 310 | if err := os.RemoveAll(path); err != nil { |
| 311 | return err |
| 312 | } |
| 313 | } |
| 314 | return nil |
| 315 | } |
| 316 | |
| 317 | // PkgGetter knows how to fetch a package given a git repo, path and ref. |
| 318 | type PkgGetter interface { |