Improve error message when unable to initialize git index repo

With this - it'll be more obvious which git repo
couldn't be initialized.
This commit is contained in:
Nipunn Koorapati 2021-09-02 21:09:31 -04:00
parent 8da3cf70cd
commit 168fac4fa3

View File

@ -88,8 +88,9 @@ impl<'cfg> RemoteRegistry<'cfg> {
// things that we don't want.
let mut opts = git2::RepositoryInitOptions::new();
opts.external_template(false);
Ok(git2::Repository::init_opts(&path, &opts)
.with_context(|| "failed to initialize index git repository")?)
Ok(git2::Repository::init_opts(&path, &opts).with_context(|| {
format!("failed to initialize index git repository (in {:?})", path)
})?)
}
}
})