Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/gitingest/ingest_from_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,21 @@ def create_file_content_string(files: List[Dict]) -> str:
output = ""
separator = "=" * 48 + "\n"

# First add README.md if it exists
for file in files:
if not file['content']:
continue
if file['path'].lower() == '/readme.md':
output += separator
output += f"File: {file['path']}\n"
output += separator
output += f"{file['content']}\n\n"
break

# Then add all other files in their original order
for file in files:
if not file['content'] or file['path'].lower() == '/readme.md':
continue
output += separator
output += f"File: {file['path']}\n"
output += separator
Expand Down
Loading