mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-28 23:55:54 +00:00
working_copy: reduce scope of an executable
variable
This commit is contained in:
parent
2102de94b0
commit
585c212617
1 changed files with 13 additions and 11 deletions
|
@ -966,13 +966,6 @@ impl TreeState {
|
||||||
if let (Some(TreeValue::Conflict(conflict_id)), FileType::Normal { executable }) =
|
if let (Some(TreeValue::Conflict(conflict_id)), FileType::Normal { executable }) =
|
||||||
(¤t_tree_value, &file_type)
|
(¤t_tree_value, &file_type)
|
||||||
{
|
{
|
||||||
#[cfg(unix)]
|
|
||||||
let executable = *executable;
|
|
||||||
#[cfg(windows)]
|
|
||||||
let executable = {
|
|
||||||
let () = executable; // use the variable
|
|
||||||
false
|
|
||||||
};
|
|
||||||
let mut file = File::open(disk_path).map_err(|err| SnapshotError::IoError {
|
let mut file = File::open(disk_path).map_err(|err| SnapshotError::IoError {
|
||||||
message: format!("Failed to open file {}", disk_path.display()),
|
message: format!("Failed to open file {}", disk_path.display()),
|
||||||
err,
|
err,
|
||||||
|
@ -989,10 +982,19 @@ impl TreeState {
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
match new_file_ids.into_resolved() {
|
match new_file_ids.into_resolved() {
|
||||||
Ok(file_id) => Ok(TreeValue::File {
|
Ok(file_id) => {
|
||||||
id: file_id.unwrap(),
|
#[cfg(unix)]
|
||||||
executable,
|
let executable = *executable;
|
||||||
}),
|
#[cfg(windows)]
|
||||||
|
let executable = {
|
||||||
|
let () = executable; // use the variable
|
||||||
|
false
|
||||||
|
};
|
||||||
|
Ok(TreeValue::File {
|
||||||
|
id: file_id.unwrap(),
|
||||||
|
executable,
|
||||||
|
})
|
||||||
|
}
|
||||||
Err(new_file_ids) => {
|
Err(new_file_ids) => {
|
||||||
if new_file_ids != old_file_ids {
|
if new_file_ids != old_file_ids {
|
||||||
let new_conflict = conflict.with_new_file_ids(&new_file_ids);
|
let new_conflict = conflict.with_new_file_ids(&new_file_ids);
|
||||||
|
|
Loading…
Reference in a new issue