mirror of
https://github.com/openai/codex.git
synced 2026-11-23 23:10:47 +00:00
[app-server] feat: add old_content and new_content to FileChange update patches
This commit is contained in:
@@ -105,10 +105,13 @@ pub(crate) fn convert_apply_patch_to_protocol(
|
||||
ApplyPatchFileChange::Update {
|
||||
unified_diff,
|
||||
move_path,
|
||||
new_content: _new_content,
|
||||
new_content,
|
||||
old_content,
|
||||
} => FileChange::Update {
|
||||
unified_diff: unified_diff.clone(),
|
||||
move_path: move_path.clone(),
|
||||
old_content: old_content.clone(),
|
||||
new_content: new_content.clone(),
|
||||
},
|
||||
};
|
||||
result.insert(path.clone(), protocol_change);
|
||||
|
||||
@@ -545,6 +545,8 @@ index {ZERO_OID}..{right_oid}
|
||||
FileChange::Update {
|
||||
unified_diff: "".to_owned(),
|
||||
move_path: None,
|
||||
old_content: "foo\n".to_owned(),
|
||||
new_content: "foo\nbar\n".to_owned(),
|
||||
},
|
||||
)]);
|
||||
acc.on_patch_begin(&update_changes);
|
||||
@@ -620,6 +622,8 @@ index {left_oid}..{ZERO_OID}
|
||||
FileChange::Update {
|
||||
unified_diff: "".to_owned(),
|
||||
move_path: Some(dest.clone()),
|
||||
old_content: "line\n".to_owned(),
|
||||
new_content: "line2\n".to_owned(),
|
||||
},
|
||||
)]);
|
||||
acc.on_patch_begin(&mv_changes);
|
||||
@@ -660,6 +664,8 @@ index {left_oid}..{right_oid}
|
||||
FileChange::Update {
|
||||
unified_diff: "".to_owned(),
|
||||
move_path: Some(dest.clone()),
|
||||
old_content: "same\n".to_owned(),
|
||||
new_content: "same\n".to_owned(),
|
||||
},
|
||||
)]);
|
||||
acc.on_patch_begin(&mv_changes);
|
||||
@@ -682,6 +688,8 @@ index {left_oid}..{right_oid}
|
||||
FileChange::Update {
|
||||
unified_diff: "".into(),
|
||||
move_path: Some(dest.clone()),
|
||||
old_content: String::new(),
|
||||
new_content: "hello\n".to_owned(),
|
||||
},
|
||||
)]);
|
||||
acc.on_patch_begin(&mv);
|
||||
@@ -722,6 +730,8 @@ index {ZERO_OID}..{right_oid}
|
||||
FileChange::Update {
|
||||
unified_diff: "".to_owned(),
|
||||
move_path: None,
|
||||
old_content: "foo\n".to_owned(),
|
||||
new_content: "foo\nbar\n".to_owned(),
|
||||
},
|
||||
)]);
|
||||
acc.on_patch_begin(&update_a);
|
||||
@@ -802,6 +812,8 @@ index {left_oid_b}..{ZERO_OID}
|
||||
FileChange::Update {
|
||||
unified_diff: "".to_owned(),
|
||||
move_path: None,
|
||||
old_content: String::new(),
|
||||
new_content: String::new(),
|
||||
},
|
||||
)]);
|
||||
acc.on_patch_begin(&update_changes);
|
||||
@@ -868,6 +880,8 @@ index {ZERO_OID}..{right_oid}
|
||||
FileChange::Update {
|
||||
unified_diff: "".to_owned(),
|
||||
move_path: None,
|
||||
old_content: "foo\n".to_owned(),
|
||||
new_content: "foo\nbar\n".to_owned(),
|
||||
},
|
||||
)]);
|
||||
acc.on_patch_begin(&update_changes);
|
||||
|
||||
Reference in New Issue
Block a user