diff options
author | David Knaack <davidkna@users.noreply.github.com> | 2022-08-18 08:25:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-18 07:25:11 +0100 |
commit | 98089bf005e97a22817eb3690b987db907f72fc0 (patch) | |
tree | 63370262f290f178ecb382bca6f134465d5244f1 | |
parent | f52ae552d3ef2c0c0c6de6429cee7b8271f14671 (diff) |
chore(git): improve logging (#4273)
-rw-r--r-- | src/context.rs | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/context.rs b/src/context.rs index bd00ce388..ac089e7ea 100644 --- a/src/context.rs +++ b/src/context.rs @@ -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(); |