mirror of
https://github.com/Llewellynvdm/starship.git
synced 2024-11-24 13:47:38 +00:00
chore(git): improve logging (#4273)
This commit is contained in:
parent
f52ae552d3
commit
98089bf005
@ -285,13 +285,25 @@ impl<'a> Context<'a> {
|
||||
..git::Permissions::default_for_level(git_sec::Trust::Full)
|
||||
});
|
||||
|
||||
let shared_repo = ThreadSafeRepository::discover_with_environment_overrides_opts(
|
||||
&self.current_dir,
|
||||
Default::default(),
|
||||
git_open_opts_map,
|
||||
)?;
|
||||
let shared_repo =
|
||||
match ThreadSafeRepository::discover_with_environment_overrides_opts(
|
||||
&self.current_dir,
|
||||
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();
|
||||
log::trace!(
|
||||
"Found git repo: {repository:?}, (trust: {:?})",
|
||||
repository.git_dir_trust()
|
||||
);
|
||||
|
||||
let branch = get_current_branch(&repository);
|
||||
let remote = get_remote_repository_info(&repository, branch.as_deref());
|
||||
let path = repository.path().to_path_buf();
|
||||
|
Loading…
Reference in New Issue
Block a user