From 876719ed9040de79f33603e59e4cb80a1f432466 Mon Sep 17 00:00:00 2001 From: Kirill Likhodedov Date: Mon, 19 Sep 2011 21:19:58 +0400 Subject: [PATCH] IDEA-74497 When reading branches from the file system, convert to "/" --- .../git4idea/src/git4idea/repo/GitRepositoryReader.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/git4idea/src/git4idea/repo/GitRepositoryReader.java b/plugins/git4idea/src/git4idea/repo/GitRepositoryReader.java index 661495960c20..2ac47ee239b1 100644 --- a/plugins/git4idea/src/git4idea/repo/GitRepositoryReader.java +++ b/plugins/git4idea/src/git4idea/repo/GitRepositoryReader.java @@ -232,7 +232,10 @@ class GitRepositoryReader { @Override public boolean process(File file) { if (!file.isDirectory()) { - branches.put(FileUtil.getRelativePath(myRefsHeadsDir, file), file); + String relativePath = FileUtil.getRelativePath(myRefsHeadsDir, file); + if (relativePath != null) { + branches.put(FileUtil.toSystemIndependentName(relativePath), file); + } } return true; } @@ -298,7 +301,9 @@ class GitRepositoryReader { public boolean process(File file) { if (!file.isDirectory()) { final String relativePath = FileUtil.getRelativePath(myRefsRemotesDir, file); - branches.add(new GitBranch(relativePath, false, true)); + if (relativePath != null) { + branches.add(new GitBranch(FileUtil.toSystemIndependentName(relativePath), false, true)); + } } return true; }