Skip to content

Commit

Permalink
Handle renamed correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Nimrod committed May 20, 2024
1 parent 79392c7 commit 5d0f045
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/display/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ enum Status {
Changed,
Created,
Deleted,
Renamed,
}

#[derive(Debug)]
Expand Down Expand Up @@ -95,11 +96,16 @@ impl<'f> From<&'f DiffResult> for File<'f> {
);

if hunks.is_empty() {
let status = if File::extract_old_path(&summary.extra_info).is_some() {
Status::Renamed
} else {
Status::Unchanged
};
return File::with_status(
&summary.file_format,
&summary.display_path,
&summary.extra_info,
Status::Unchanged,
status,
);
}

Expand Down

0 comments on commit 5d0f045

Please sign in to comment.