pub fn ensure_git_repo(dir: &str) -> Result<()>
Ensure the provided directory is inside a git work tree.
Returns an error when the directory is not part of a git repository.