Skip to content

Commit

Permalink
Reinitialize index on "Object not found" error.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Sep 25, 2020
1 parent 05c611a commit 3bbb44c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cargo/sources/git/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,8 @@ pub fn fetch(
};
debug!("fetch failed: {}", err);

if !repo_reinitialized && err.class() == git2::ErrorClass::Reference {
if !repo_reinitialized && matches!(err.class(), ErrorClass::Reference | ErrorClass::Odb)
{
repo_reinitialized = true;
debug!(
"looks like this is a corrupt repository, reinitializing \
Expand Down

0 comments on commit 3bbb44c

Please sign in to comment.