Skip to content

Commit a3818a5

Browse files
author
codegen-bot
committed
Fix bug
1 parent 05694c6 commit a3818a5

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/codegen/sdk/codebase/codebase_graph.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -249,17 +249,14 @@ def _reset_files(self, syncs: list[DiffLite]) -> None:
249249
elif sync.change_type == ChangeType.Modified:
250250
files_to_write.append((sync.path, sync.old_content))
251251
modified_files.add(sync.path)
252-
logger.info(f"Writing {sync.path} to disk with content {sync.old_content}")
253252
elif sync.change_type == ChangeType.Renamed:
254-
files_to_rename.append((sync.rename_to, sync.rename_from))
253+
files_to_write.append((sync.rename_from, sync.old_content))
254+
files_to_remove.append(sync.rename_to)
255255
modified_files.add(sync.rename_from)
256256
modified_files.add(sync.rename_to)
257257
elif sync.change_type == ChangeType.Added:
258258
files_to_remove.append(sync.path)
259259
modified_files.add(sync.path)
260-
logger.info(f"Writing {len(files_to_remove)} files to remove")
261-
logger.info(f"Writing {len(files_to_write)} files to write")
262-
logger.info(f"Writing {len(files_to_rename)} files to rename")
263260
write_changes(files_to_remove, files_to_write, files_to_rename)
264261

265262
@stopwatch

src/codegen/sdk/codebase/transactions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def execute(self) -> None:
269269

270270
def get_diff(self) -> DiffLite:
271271
"""Gets the diff produced by this transaction"""
272-
return DiffLite(ChangeType.Renamed, self.file_path, self.file_path, self.new_file_path)
272+
return DiffLite(ChangeType.Renamed, self.file_path, self.file_path, self.new_file_path, old_content=self.file.content_bytes)
273273

274274
def diff_str(self) -> str:
275275
"""Human-readable string representation of the change"""

0 commit comments

Comments
 (0)