Skip to content

Commit

Permalink
working_copy: remove matching that's always against _
Browse files Browse the repository at this point in the history
  • Loading branch information
martinvonz committed Jul 6, 2023
1 parent 868188c commit 8af22eb
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions lib/src/working_copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -928,23 +928,19 @@ impl TreeState {
file_state.mark_executable(executable);
stats.updated_files += 1;
}
Diff::Modified(before, after) => {
Diff::Modified(_before, after) => {
fs::remove_file(&disk_path).ok();
let file_state = match (before, after) {
(_, TreeValue::File { id, executable }) => {
let file_state = match after {
TreeValue::File { id, executable } => {
self.write_file(&disk_path, &path, &id, executable)?
}
(_, TreeValue::Symlink(id)) => {
self.write_symlink(&disk_path, &path, &id)?
}
(_, TreeValue::Conflict(id)) => {
self.write_conflict(&disk_path, &path, &id)?
}
(_, TreeValue::GitSubmodule(_id)) => {
TreeValue::Symlink(id) => self.write_symlink(&disk_path, &path, &id)?,
TreeValue::Conflict(id) => self.write_conflict(&disk_path, &path, &id)?,
TreeValue::GitSubmodule(_id) => {
println!("ignoring git submodule at {path:?}");
FileState::for_gitsubmodule()
}
(_, TreeValue::Tree(_id)) => {
TreeValue::Tree(_id) => {
panic!("unexpected tree entry in diff at {path:?}");
}
};
Expand Down

0 comments on commit 8af22eb

Please sign in to comment.