public Revision toRevision(GitClient git) throws InterruptedException { if (revision != null) { return revision; } ObjectId sha1 = git.revParse(commit); Revision revision = new Revision(sha1); // Here we do not have any local branches, containing the commit. So... // we are to get all the remote branches, and show them to users, as // they are local final List<Branch> branches = normalizeBranches(git.getBranchesContaining( ObjectId.toString(sha1), true)); revision.getBranches().addAll(branches); return revision; }