Sandbox lose hidden folder

Answered

I'm developing a plugin which need to check git project by GitUtil.isGitRoot() method,but the return value is always false. I figure out the project .git folder is missing when run in the sandbox,How can i solve this problem

3 comments
Comment actions Permalink

Hi,

I don't understand what is the relation of the ".git" folder to the Sandbox folder. Where is the ".git" folder? Does it disappear from the file system?

It's hard to help with so little information and I suggest debugging GitUtil.isGitRoot() to find out why it returns false.

0
Comment actions Permalink

Sorry for my ambiguous description, Let me explain it with some screenshot.

1. the VCSLabel plugin i'm developing need to check project is a git repository or not

2. Project boottest is under 'D:/ideaprojects/boottest' and it's a git repository.

3. I run the runIde task and open the project boottest,return value of ProjectUtil.getProjectPath(project.getName()) is 'D:\ideaprojects\VCSLabel\build\idea-sandbox\config\projects\boottest' not actual path 'D:/ideaprojects/boottest'

4.  Wrong projectPath cause GitUtil.isGitRoot() return false

5. I debug the GitUtil.isGitRoot() method and figout out root cause of the 'return value false' is .git folder not found in the projectPath

0
Comment actions Permalink

Hi,

Thanks for the clarification.

At first, you shouldn't use classes from "impl" packages and ProjectUtil is one. This is an internal class and can be changed, so relying on it may break your plugin in the future. Also, the path definitely is not the path of the project you want to check.

Please use one of the Project class methods (please carefully read JavaDocs about caveats).

0

Please sign in to leave a comment.