瀏覽代碼

Add parsing of clean.requireForce.

Jelmer Vernooij 4 年之前
父節點
當前提交
7224dbc622
共有 1 個文件被更改,包括 6 次插入0 次删除
  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)