vscode-gradle icon indicating copy to clipboard operation
vscode-gradle copied to clipboard

Could not get top level Git directory

Open guest73 opened this issue 6 months ago • 12 comments

Extension Name: vscode-gradle Extension Version: 3.16.2 OS Version: Linux Mint 21.3 VSCode version: 1.92.0

Describe the bug When I try to open a Java-Gradle project I get this error message

* What went wrong:
A problem occurred evaluating root project 'fo.server'.
> Failed to apply plugin 'booqstrap.flyway-conventions'.
   > Failed to apply plugin 'booqstrap.misc-conventions'.
      > Could not get top level Git directory, make sure your project is in a valid Git repository

Those plugins are our own custom Gradle plugins to automate some repetitive task for many projects we have. And they require a project to be in a git repo so the version is automatically identified. A simple command

gitRunner.runGitCommand("rev-parse", "--show-toplevel")

is issued for that purpose. The thing is that Language Support for Java(TM) by Red Hat works fine and there is no such a problem. The project is imported and I can edit code in vscode, do auto-completion ect. But once I install vscode-gradle and do ‘Java: Clean Java Language Server Workspace > Reload and delete‘ - everything breaks.

Expected behavior My project opens correctly by the plugin without any errors.

Additional context I expect that some "current directory" is incorrectly set by the extension.

guest73 avatar Aug 08 '24 14:08 guest73