feat: resolve conflicts

This commit is contained in:
geekan 2023-12-14 23:54:38 +08:00 committed by 莘权 马
parent ad0ac94093
commit b97ca3af7e
12 changed files with 120 additions and 90 deletions

View file

@ -223,10 +223,15 @@ class CodeParser:
# 遍历所有的block
for block in blocks:
# 如果block不为空则继续处理
if block.strip() != "":
if block.strip() == "":
continue
if "\n" not in block:
block_title = block
block_content = ""
else:
# 将block的标题和内容分开并分别去掉前后的空白字符
block_title, block_content = block.split("\n", 1)
block_dict[block_title.strip()] = block_content.strip()
block_dict[block_title.strip()] = block_content.strip()
return block_dict

View file

@ -233,6 +233,8 @@ class GitRepository:
files = []
try:
directory_path = Path(self.workdir) / relative_path
if not directory_path.exists():
return []
for file_path in directory_path.iterdir():
if file_path.is_file():
rpath = file_path.relative_to(root_relative_path)