Write absolute path to commit.template config var

This means that `git-mob` will work in git submodules.

Co-authored-by: Maria Hansson <mariahansson92@hotmail.com>
This commit is contained in:
Martin Frost 2022-05-13 18:26:16 +02:00
parent 6820d9b3ae
commit 8ec0cba227
1 changed files with 4 additions and 3 deletions

View File

@ -49,9 +49,10 @@ pub fn set_main_author(author: &Author) {
pub fn ensure_commit_template_is_set() { pub fn ensure_commit_template_is_set() {
with_git_repo_or_exit(|repo| { with_git_repo_or_exit(|repo| {
let mut config = repo.config().unwrap(); let mut config = repo.config().unwrap();
config let template_path = repo.path().join(".gitmessage");
.set_str("commit.template", ".git/.gitmessage") if let Some(template_path) = template_path.to_str() {
.unwrap(); config.set_str("commit.template", template_path).unwrap();
}
}) })
} }