Fix crash on renaming files

ida_star
Wilfred Hughes 2021-08-22 23:51:41 +07:00
parent dff8eb0a65
commit fad0775315
2 changed files with 10 additions and 2 deletions

@ -1,10 +1,12 @@
## 0.7 (unreleased)
### Diffing
### Git integration
Fixed issues when adding/removing a whole file meant that difftastic
didn't display anything.
Fixed a crash on renaming a file.
### Display
Side-by-side display now uses "..." for column numbers when aligning

@ -79,7 +79,13 @@ fn main() {
// https://git-scm.com/docs/git#Documentation/git.txt-codeGITEXTERNALDIFFcode
(display_path, lhs_tmp_file, rhs_tmp_file)
}
_ => panic!("Expected 2 arguments or 7 arguments, got {}: {:?}", args.len(), args),
[_old_name, lhs_tmp_file, _lhs_hash, _lhs_mode, rhs_tmp_file, _rhs_hash, _rhs_mode, new_name, _similarity] => {
// Rename file.
// TODO: mention old name as well as diffing.
// TODO: where does git document these 9 arguments?
(new_name, lhs_tmp_file, rhs_tmp_file)
}
_ => panic!("Unexpected number of arguments, got {}: {:?}", args.len(), args),
};
let lhs_bytes = read_or_die(lhs_path);