diff --git a/src/main/kotlin/ee/carlrobert/codegpt/codecompletions/InfillRequestUtil.kt b/src/main/kotlin/ee/carlrobert/codegpt/codecompletions/InfillRequestUtil.kt index 25f00c7f..b793c549 100644 --- a/src/main/kotlin/ee/carlrobert/codegpt/codecompletions/InfillRequestUtil.kt +++ b/src/main/kotlin/ee/carlrobert/codegpt/codecompletions/InfillRequestUtil.kt @@ -31,7 +31,7 @@ object InfillRequestUtil { val project = request.editor.project ?: return infillRequestBuilder.build() val repository = GitUtil.getProjectRepository(project) - if (repository != null) { + if (repository != null && service().state.codeCompletionSettings.gitDiffEnabled) { try { val unstagedDiff = GitUtil.getUnstagedDiff(project, repository) if (unstagedDiff.isNotEmpty()) { diff --git a/src/main/kotlin/ee/carlrobert/codegpt/util/GitUtil.kt b/src/main/kotlin/ee/carlrobert/codegpt/util/GitUtil.kt index e8c84e30..63fc04ea 100644 --- a/src/main/kotlin/ee/carlrobert/codegpt/util/GitUtil.kt +++ b/src/main/kotlin/ee/carlrobert/codegpt/util/GitUtil.kt @@ -26,7 +26,6 @@ object GitUtil { ): List { val handler = GitLineHandler(project, gitRepository.root, GitCommand.DIFF) handler.addParameters( - "--cached", "--unified=1", "--diff-filter=AM", "--no-prefix",