aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/git.rs19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/git.rs b/src/git.rs
index 7ad919f..479a3c5 100644
--- a/src/git.rs
+++ b/src/git.rs
@@ -22,14 +22,17 @@ pub fn mirror<P: AsRef<Path>>(
path: P,
description: Option<&str>,
) -> Result<(), Error> {
- let mut repo_init_options = git2::RepositoryInitOptions::new();
- repo_init_options.bare(true);
-
- if let Some(d) = description {
- repo_init_options.description(d);
- }
-
- let repo = git2::Repository::init_opts(path, &repo_init_options)?;
+ let description_str = match description {
+ Some(d) => d,
+ None => "",
+ };
+
+ let repo = git2::Repository::init_opts(
+ path,
+ &git2::RepositoryInitOptions::new()
+ .bare(true)
+ .description(description_str),
+ )?;
let remote_name = "origin";