MCPcopy
hub / github.com/go-git/go-git / cleanUpDir

Function cleanUpDir

repository.go:537–554  ·  view source on GitHub ↗
(path string, all bool)

Source from the content-addressed store, hash-verified

535}
536
537func cleanUpDir(path string, all bool) error {
538 if all {
539 return util.RemoveAll(osfs.Default, path)
540 }
541
542 files, err := osfs.Default.ReadDir(path)
543 if err != nil {
544 return err
545 }
546
547 for _, fi := range files {
548 if err := util.RemoveAll(osfs.Default, osfs.Default.Join(path, fi.Name())); err != nil {
549 return err
550 }
551 }
552
553 return err
554}
555
556// Config return the repository config. In a filesystem backed repository this
557// means read the `.git/config`.

Callers 1

PlainCloneContextFunction · 0.85

Calls 3

JoinMethod · 0.80
NameMethod · 0.65
ReadDirMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…