Skip to content

Commit

Permalink
scs: use into_response to populate file_info in commit_path_info resp…
Browse files Browse the repository at this point in the history
…onse

Summary: `commit_path_info` currently only partially populates `file_info` in its response which can be surprising. Let's use the `into_response` implementation of `FileInfo` instead to fully populate it.

Reviewed By: singhsrb

Differential Revision: D67140714

fbshipit-source-id: 553feae467571ef399707e3f04e61faff0cc449a
  • Loading branch information
YousefSalama authored and facebook-github-bot committed Dec 12, 2024
1 parent 4b23007 commit 7a05197
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions eden/mononoke/scs/scs_methods/src/methods/commit_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,7 @@ impl SourceControlServiceImpl {
}
}
PathEntry::File(file, file_type) => {
let metadata = file.metadata().await?;
let file_info = thrift::FileInfo {
id: metadata.content_id.as_ref().to_vec(),
file_size: metadata.total_size as i64,
content_sha1: metadata.sha1.as_ref().to_vec(),
content_sha256: metadata.sha256.as_ref().to_vec(),
..Default::default()
};
let file_info = file.metadata().await?.into_response();
thrift::CommitPathInfoResponse {
exists: true,
r#type: Some(file_type.into_response()),
Expand Down

0 comments on commit 7a05197

Please sign in to comment.