Skip to content

Etc merge fix#1649

Merged
cgwalters merged 2 commits intobootc-dev:mainfrom
Johan-Liebert1:etc-merge-fix
Sep 25, 2025
Merged

Etc merge fix#1649
cgwalters merged 2 commits intobootc-dev:mainfrom
Johan-Liebert1:etc-merge-fix

Conversation

@Johan-Liebert1
Copy link
Copy Markdown
Collaborator

No description provided.

We weren't checking if the deleted path is a file or a directory and
were calling `remove_file` unconditionally. Update to check for
file/directory first

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
@Johan-Liebert1 Johan-Liebert1 marked this pull request as ready for review September 25, 2025 05:46
@bootc-bot bootc-bot bot requested a review from jeckersb September 25, 2025 05:46
print_diff(&diff, &mut std::io::stdout());

if merge {
let n = n.ok_or(anyhow::anyhow!("Failed to get dirtree for new etc"))?;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think clippy will want ok_or_else to avoid constructing the error always (here and elsewhere)

Err(e) => Err(e)?,
let stat = new_etc_fd.metadata_optional(&removed)?;

let stat = match stat {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also a let-else candidate

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
traverse_etc(&pristine_etc, &current_etc, &new_etc)?;
traverse_etc(&pristine_etc, &current_etc, Some(&new_etc))?;

let new_files = new_files.ok_or(anyhow::anyhow!("Failed to get dirtree for new etc"))?;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NB another ok_or_else

@cgwalters cgwalters enabled auto-merge (rebase) September 25, 2025 15:14
@cgwalters cgwalters merged commit c503391 into bootc-dev:main Sep 25, 2025
23 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants