Skip to content

Commit

Permalink
fix: don't panic during checkouts when submodules or sparse directori…
Browse files Browse the repository at this point in the history
…es are encountered.

Now we trace instead.
  • Loading branch information
Byron committed Aug 2, 2023
1 parent a08d851 commit 82ae37d
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions gix-worktree/src/checkout/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,20 @@ where
entry.stat = Stat::from_fs(&std::fs::symlink_metadata(dest)?)?;
obj.data.len()
}
gix_index::entry::Mode::DIR => todo!(),
gix_index::entry::Mode::COMMIT => 0,
gix_index::entry::Mode::DIR => {
gix_features::trace::warn!(
"Skipped sparse directory at '{entry_path}' ({id}) as it cannot yet be handled",
id = entry.id
);
0
}
gix_index::entry::Mode::COMMIT => {
gix_features::trace::warn!(
"Skipped submodule at '{entry_path}' ({id}) as it cannot yet be handled",
id = entry.id
);
0
}
_ => unreachable!(),
};
Ok(Outcome::Written { bytes: object_size })
Expand Down

0 comments on commit 82ae37d

Please sign in to comment.