mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Return Git root, not Git repository folder
Follow-up to e6c8b18, which works incorrectly e.g. for worktrees.
The issue found in IDEA-CR-21166
This commit is contained in:
@@ -368,8 +368,9 @@ public class GitUtil {
|
||||
public static VirtualFile getGitRootOrNull(@NotNull final FilePath filePath) {
|
||||
File root = filePath.getIOFile();
|
||||
while (root != null) {
|
||||
File gitDir = findGitDir(root);
|
||||
if (gitDir != null) return LocalFileSystem.getInstance().findFileByIoFile(root);
|
||||
if (isGitRoot(root)) {
|
||||
return LocalFileSystem.getInstance().findFileByIoFile(root);
|
||||
}
|
||||
root = root.getParentFile();
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user