1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-11-24 21:57:41 +00:00

chore(git): improve logging (#4273)

This commit is contained in:
David Knaack 2022-08-18 08:25:11 +02:00 committed by GitHub
parent f52ae552d3
commit 98089bf005
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -285,13 +285,25 @@ impl<'a> Context<'a> {
..git::Permissions::default_for_level(git_sec::Trust::Full) ..git::Permissions::default_for_level(git_sec::Trust::Full)
}); });
let shared_repo = ThreadSafeRepository::discover_with_environment_overrides_opts( let shared_repo =
&self.current_dir, match ThreadSafeRepository::discover_with_environment_overrides_opts(
Default::default(), &self.current_dir,
git_open_opts_map, Default::default(),
)?; git_open_opts_map,
) {
Ok(repo) => repo,
Err(e) => {
log::debug!("Failed to find git repo: {e}");
return Err(e);
}
};
let repository = shared_repo.to_thread_local(); let repository = shared_repo.to_thread_local();
log::trace!(
"Found git repo: {repository:?}, (trust: {:?})",
repository.git_dir_trust()
);
let branch = get_current_branch(&repository); let branch = get_current_branch(&repository);
let remote = get_remote_repository_info(&repository, branch.as_deref()); let remote = get_remote_repository_info(&repository, branch.as_deref());
let path = repository.path().to_path_buf(); let path = repository.path().to_path_buf();