Skip to content

Commit

Permalink
- Fixed "Expected directory instead of file" if .git is a file (wor…
Browse files Browse the repository at this point in the history
…ktrees case) #842
  • Loading branch information
hsz committed Oct 6, 2023
1 parent 38918b8 commit 8ca7948
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
- Improve module root detection in Rider
- Fixed issue when starring the template, marks both `gitignore` and `toptal` entries [\#844](https://github.com/hsz/idea-gitignore/issues/844)
- Fixed ConcurrentModificationException in UnignoreFileGroupAction#GetChildren [\#860](https://github.com/hsz/idea-gitignore/issues/860)
- Fixed UI freeze caused by `BulkFileListener.handleEvent`
- Fixed "Expected directory instead of file" if `.git` is a file (worktrees case) [\#842](https://github.com/hsz/idea-gitignore/issues/842)

## [4.5.1] - 2023-06-22
- Fixed `Slow operations are prohibited on EDT` [\#831](https://github.com/hsz/idea-gitignore/issues/831)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import com.intellij.openapi.fileEditor.FileEditorManager
import com.intellij.openapi.project.DumbService
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.openapi.vfs.findDirectory
import com.intellij.psi.PsiManager
import com.intellij.ui.EditorNotificationPanel
import com.intellij.ui.EditorNotificationProvider
Expand Down Expand Up @@ -74,7 +73,7 @@ class MissingGitignoreNotificationProvider(project: Project) : EditorNotificatio

val vcsDirectory = GitLanguage.INSTANCE.vcsDirectory ?: return null
val moduleRoot = Utils.getModuleRootForFile(file, project) ?: return null
moduleRoot.findDirectory(vcsDirectory) ?: return null
moduleRoot.findChild(vcsDirectory) ?: return null

if (moduleRoot.findChild(GitLanguage.INSTANCE.filename) != null) {
return null
Expand Down

0 comments on commit 8ca7948

Please sign in to comment.