MCPcopy Index your code
hub / github.com/go-git/go-git / removeEmptyDirectory

Method removeEmptyDirectory

worktree_status.go:638–649  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

636}
637
638func (w *Worktree) removeEmptyDirectory(path string) error {
639 files, err := w.Filesystem.ReadDir(path)
640 if err != nil {
641 return err
642 }
643
644 if len(files) != 0 {
645 return nil
646 }
647
648 return w.Filesystem.Remove(path)
649}
650
651func (w *Worktree) doRemoveFile(idx *index.Index, path string) (plumbing.Hash, error) {
652 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