git2-rs icon indicating copy to clipboard operation
git2-rs copied to clipboard

`RepositoryInitOptions::description` is ignored

Open gifnksm opened this issue 3 years ago • 2 comments

RepositoryInitOptions::description seems to be ignored:

// src/main.rs
fn main() -> Result<(), Box<dyn std::error::Error>> {
    let _ = git2::Repository::init_opts(
        "test",
        git2::RepositoryInitOptions::new().description("test"),
    )?;
    Ok(())
}
$ cargo run
$ cat test/.git/description
Unnamed repository; edit this file 'description' to name the repository.

gifnksm avatar Jun 06 '22 08:06 gifnksm

Do you perhaps have init.templateDir configured in your global config? It defaults to using that (overriding the init options).

ehuss avatar Jun 06 '22 14:06 ehuss

It seems that init.templateDir is not set in my environment.

$ git config init.templateDir
# no output

gifnksm avatar Jun 07 '22 14:06 gifnksm