1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-11-28 15:56:28 +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 =
match ThreadSafeRepository::discover_with_environment_overrides_opts(
&self.current_dir, &self.current_dir,
Default::default(), Default::default(),
git_open_opts_map, 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();