+ def clean(self, directories=False, force=False, dry_run=False):
+ """
+ Remove untracked files from the working tree.
+
+ @param directories: remove untracked directories, too
+ @type directories: C{bool}
+ @param force: satisfy git configuration variable clean.requireForce
+ @type force: C{bool}
+ @param dry_run: don’t actually remove anything
+ @type dry_run: C{bool}
+ """
+ options = GitArgs()
+ options.add_true(directories, '-d')
+ options.add_true(force, '-f')
+ options.add_true(dry_run, '-n')
+
+ _out, err, ret = self._git_inout('clean', options.args,
+ extra_env={'LC_ALL': 'C'})
+ if ret:
+ raise GitRepositoryError("Can't execute repository clean: %s" % err)
+