Skip to content

Commit 54e5e83

Browse files
committed
fix: unstaged git diff
1 parent 4e5b280 commit 54e5e83

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/main/kotlin/ee/carlrobert/codegpt/codecompletions/InfillRequestUtil.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ object InfillRequestUtil {
3131

3232
val project = request.editor.project ?: return infillRequestBuilder.build()
3333
val repository = GitUtil.getProjectRepository(project)
34-
if (repository != null) {
34+
if (repository != null && service<ConfigurationSettings>().state.codeCompletionSettings.gitDiffEnabled) {
3535
try {
3636
val unstagedDiff = GitUtil.getUnstagedDiff(project, repository)
3737
if (unstagedDiff.isNotEmpty()) {

src/main/kotlin/ee/carlrobert/codegpt/util/GitUtil.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ object GitUtil {
2626
): List<GitDiffDetails> {
2727
val handler = GitLineHandler(project, gitRepository.root, GitCommand.DIFF)
2828
handler.addParameters(
29-
"--cached",
3029
"--unified=1",
3130
"--diff-filter=AM",
3231
"--no-prefix",

0 commit comments

Comments
 (0)