summaryrefslogtreecommitdiff
path: root/plugins/git4idea/src/git4idea/GitUtil.java
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/git4idea/src/git4idea/GitUtil.java')
-rw-r--r--plugins/git4idea/src/git4idea/GitUtil.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/plugins/git4idea/src/git4idea/GitUtil.java b/plugins/git4idea/src/git4idea/GitUtil.java
index 5f56de5674e1..4ff61fb4a68b 100644
--- a/plugins/git4idea/src/git4idea/GitUtil.java
+++ b/plugins/git4idea/src/git4idea/GitUtil.java
@@ -37,7 +37,6 @@ import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vcs.changes.Change;
import com.intellij.openapi.vcs.changes.ChangeListManager;
import com.intellij.openapi.vcs.changes.ChangeListManagerEx;
-import com.intellij.openapi.vcs.changes.FilePathsHelper;
import com.intellij.openapi.vcs.versionBrowser.CommittedChangeList;
import com.intellij.openapi.vcs.vfs.AbstractVcsVirtualFile;
import com.intellij.openapi.vfs.LocalFileSystem;
@@ -778,6 +777,8 @@ public class GitUtil {
/**
* Returns absolute paths which have changed remotely comparing to the current branch, i.e. performs
* <code>git diff --name-only master..origin/master</code>
+ * <p/>
+ * Paths are absolute, Git-formatted (i.e. with forward slashes).
*/
@NotNull
public static Collection<String> getPathsDiffBetweenRefs(@NotNull Git git, @NotNull GitRepository repository,
@@ -797,7 +798,7 @@ public class GitUtil {
continue;
}
final String path = repository.getRoot().getPath() + "/" + unescapePath(relative);
- remoteChanges.add(FilePathsHelper.convertPath(path));
+ remoteChanges.add(path);
}
return remoteChanges;
}
@@ -1024,4 +1025,14 @@ public class GitUtil {
ApplicationManager.getApplication().getMessageBus().syncPublisher(BatchFileChangeListener.TOPIC).batchChangeCompleted(project);
}
+ @NotNull
+ public static String cleanupErrorPrefixes(@NotNull String msg) {
+ final String[] PREFIXES = { "fatal:", "error:" };
+ for (String prefix : PREFIXES) {
+ if (msg.startsWith(prefix)) {
+ return msg.substring(prefix.length()).trim();
+ }
+ }
+ return msg;
+ }
}