diff --git a/app/src/git_commit_generator/changelog_generator.py b/app/src/git_commit_generator/changelog_generator.py index 4de636a..aab0756 100644 --- a/app/src/git_commit_generator/changelog_generator.py +++ b/app/src/git_commit_generator/changelog_generator.py @@ -28,6 +28,7 @@ class ChangelogGenerator: self, config: Optional[Config] = None, ollama_client: Optional[OllamaClient] = None, + git_utils: Optional[GitUtils] = None, repo_path: Optional[str] = None, ): """Initialize changelog generator.""" @@ -36,7 +37,7 @@ class ChangelogGenerator: host=self.config.ollama_host, model=self.config.ollama_model ) - self.git_utils = GitUtils(repo_path) + self.git_utils = git_utils or GitUtils(repo_path) def generate( self, @@ -160,11 +161,13 @@ Group by type (feat, fix, docs, etc.) and format properly.""" def get_changelog_generator( config: Optional[Config] = None, ollama_client: Optional[OllamaClient] = None, + git_utils: Optional[GitUtils] = None, repo_path: Optional[str] = None, ) -> ChangelogGenerator: """Get ChangelogGenerator instance.""" return ChangelogGenerator( config=config, ollama_client=ollama_client, + git_utils=git_utils, repo_path=repo_path, )