*/\r
package com.gitblit.wicket.panels;\r
\r
+import java.util.Collections;\r
import java.util.Date;\r
import java.util.List;\r
import java.util.Map;\r
import org.apache.wicket.markup.repeater.data.DataView;\r
import org.apache.wicket.markup.repeater.data.ListDataProvider;\r
import org.apache.wicket.model.StringResourceModel;\r
+import org.eclipse.jgit.diff.DiffEntry.ChangeType;\r
import org.eclipse.jgit.lib.ObjectId;\r
import org.eclipse.jgit.lib.Repository;\r
import org.eclipse.jgit.revwalk.RevCommit;\r
+import org.eclipse.jgit.treewalk.TreeWalk;\r
+import org.eclipse.jgit.treewalk.filter.PathFilterGroup;\r
\r
import com.gitblit.Constants;\r
import com.gitblit.GitBlit;\r
break;\r
}\r
}\r
+ if (matchingPath == null) {\r
+ // path not in commit\r
+ // manually locate path in tree\r
+ TreeWalk tw = new TreeWalk(r);\r
+ tw.reset();\r
+ tw.setRecursive(true);\r
+ try {\r
+ tw.addTree(commit.getTree());\r
+ tw.setFilter(PathFilterGroup.createFromStrings(Collections.singleton(path)));\r
+ while (tw.next()) {\r
+ matchingPath = new PathChangeModel(tw.getPathString(), tw.getPathString(), 0, tw\r
+ .getRawMode(0), tw.getObjectId(0).getName(), commit.getId().getName(),\r
+ ChangeType.MODIFY);\r
+ }\r
+ } catch (Exception e) {\r
+ } finally {\r
+ tw.release();\r
+ }\r
+ }\r
+ \r
final boolean isTree = matchingPath == null ? true : matchingPath.isTree();\r
\r
final Map<ObjectId, List<RefModel>> allRefs = JGitUtils.getAllRefs(r, showRemoteRefs);\r