Browse Source

Add parsing of clean.requireForce.

Jelmer Vernooij 4 năm trước cách đây
mục cha
commit
7224dbc622
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  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)