summaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2020-06-14 21:13:57 -0400
committerDan Davison <dandavison7@gmail.com>2020-06-14 21:13:57 -0400
commit0cd663d5292f757329d944ef132c205532200396 (patch)
tree5641b71171b39a2c8854c451c7ed50f2823bdb72 /src/main.rs
parentae08bf2bea6b2f9316ef57fbd4940783f3c019ec (diff)
Refactor: get_git_config
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/main.rs b/src/main.rs
index 3ae276bf..821acbd8 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -47,18 +47,10 @@ mod errors {
}
fn main() -> std::io::Result<()> {
- let mut git_config = match std::env::current_dir() {
- Ok(dir) => match git2::Repository::discover(dir) {
- Ok(repo) => match repo.config() {
- Ok(config) => Some(config),
- Err(_) => None,
- },
- Err(_) => None,
- },
- Err(_) => None,
- };
-
- let config = config::Config::from_arg_matches(cli::Opt::clap().get_matches(), &mut git_config);
+ let config = config::Config::from_arg_matches(
+ cli::Opt::clap().get_matches(),
+ &mut git_config::get_git_config(),
+ );
if config.list_languages {
list_languages()?;