Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import com.xiplink.jira.git.GitManager;
import com.xiplink.jira.git.ViewLinkFormat;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Map;
import org.apache.commons.lang.StringUtils;
import org.eclipse.jgit.lib.ObjectId;
Expand Down Expand Up @@ -74,6 +76,12 @@ public String getChangePathLinkHtml(RevCommit revision, FileDiff path) {
"${parent}", revision.getParent(0).getId().name()
);

try {
subst.put("${encpath}", URLEncoder.encode(path.getPath(),"UTF-8").replace("+", "%20"));
} catch (UnsupportedEncodingException e) {
assert false;
}

ObjectId[] blobs = path.getBlobs();
if (blobs.length == 1) {
subst.put("${blob}", blobs[0].name());
Expand Down
13 changes: 12 additions & 1 deletion src/main/resources/gitweblinktypes.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
types=cgit fisheye github gitorius gitweb
types=cgit fisheye github gitorius gitweb gitblit

#---------------------------------
# gitweb
Expand Down Expand Up @@ -69,3 +69,14 @@ rhodecode.changeset=https://<your_rhode_code_url>/<your_repo_name>/changeset/${r
rhodecode.file.added=https://<your_rhode_code_url>/<your_repo_name>/files/${rev}/${path}
rhodecode.file.modified=https://<your_rhode_code_url>/<your_repo_name>/diff/${path}?diff2=${rev}&diff1=${parent}&fulldiff=1&diff=diff
rhodecode.file.deleted=https://<your_rhode_code_url>/<your_repo_name>/diff/${path}?diff2=${rev}&diff1=${parent}&fulldiff=1&diff=diff

#---------------------------------
# gitblit
#---------------------------------
gitblit.name=GitBlit
gitblit.view=
gitblit.changeset=${origin}/commitdiff/<project>/${rev}
gitblit.file.added=${origin}/blob/<project>/${rev}/${encpath}
gitblit.file.modified=${origin}/blobdiff/<project>/${rev}/${encpath}
gitblit.file.deleted=${origin}/history/<project>/${rev}/${encpath}