Explorar o código

Add parsing of clean.requireForce.

Jelmer Vernooij %!s(int64=4) %!d(string=hai) anos
pai
achega
7224dbc622
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      dulwich/porcelain.py

+ 6 - 0
dulwich/porcelain.py

@@ -480,6 +480,12 @@ def clean(repo=".", target_dir=None):
         if not _is_subdir(target_dir, r.path):
             raise Error("target_dir must be in the repo's working dir")
 
+        config = r.get_config_stack()
+        require_force = config.get_boolean((b'clean',), b'requireForce', True)
+
+        # TODO(jelmer): if require_force is set, then make sure that -f, -i or
+        # -n is specified.
+
         index = r.open_index()
         ignore_manager = IgnoreFilterManager.from_repo(r)