Skip to content

Commit 168fac4

Browse files
committed
Improve error message when unable to initialize git index repo
With this - it'll be more obvious which git repo couldn't be initialized.
1 parent 8da3cf7 commit 168fac4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/cargo/sources/registry/remote.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ impl<'cfg> RemoteRegistry<'cfg> {
8888
// things that we don't want.
8989
let mut opts = git2::RepositoryInitOptions::new();
9090
opts.external_template(false);
91-
Ok(git2::Repository::init_opts(&path, &opts)
92-
.with_context(|| "failed to initialize index git repository")?)
91+
Ok(git2::Repository::init_opts(&path, &opts).with_context(|| {
92+
format!("failed to initialize index git repository (in {:?})", path)
93+
})?)
9394
}
9495
}
9596
})

0 commit comments

Comments
 (0)