MCPcopy Create free account
hub / github.com/go-git/go-git / removeEmptyDirectory

Method removeEmptyDirectory

worktree_status.go:609–620  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

607}
608
609func (w *Worktree) removeEmptyDirectory(path string) error {
610 files, err := w.Filesystem.ReadDir(path)
611 if err != nil {
612 return err
613 }
614
615 if len(files) != 0 {
616 return nil
617 }
618
619 return w.Filesystem.Remove(path)
620}
621
622func (w *Worktree) doRemoveFile(idx *index.Index, path string) (plumbing.Hash, error) {
623 hash, err := w.deleteFromIndex(idx, path)

Callers 2

doRemoveDirectoryMethod · 0.95
RemoveGlobMethod · 0.95

Calls 2

ReadDirMethod · 0.45
RemoveMethod · 0.45

Tested by

no test coverage detected