List<WatchEvent<?>> notifyDiffs(final JGitFileSystem fs, final String _tree, final String sessionId, final String userName, final String message, final ObjectId oldHead, final ObjectId newHead) { List<WatchEvent<?>> watchEvents = compareDiffs(fs, _tree, sessionId, userName, message, oldHead, newHead); final String tree; if (_tree.startsWith("refs/")) { tree = _tree.substring(_tree.lastIndexOf("/") + 1); } else { tree = _tree; } final String host = tree + "@" + fs.getName(); final Path root = JGitPathImpl.createRoot(fs, "/", host, false); if (!watchEvents.isEmpty()) { fs.publishEvents(root, watchEvents); } return watchEvents; }