File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed
Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -16,16 +16,31 @@ function createLink(linkData) {
1616
1717 if ( linkData . dir ) {
1818
19- [ user , repo , contents ] = linkData . dir ;
19+ const [ user , repo , contents ] = linkData . dir ;
20+ let [ repoName , branch ] = repo . split ( ':' ) ;
2021
2122 if ( user && repo ) {
2223
23- link += '/' + encodeURIComponent ( user ) +
24- '/' + encodeURIComponent ( repo ) ;
24+ const modRepo = modifiedRepos [ user + '/' + repoName ] ;
25+
26+ if ( modRepo && modRepo . branches
27+ && modRepo . branches . length === 1 ) {
28+
29+ branch = '' ;
30+
31+ } else {
32+
33+ branch = ':' + branch ;
34+
35+ }
36+
37+
38+ link += '/' + encodeURI ( user ) +
39+ '/' + encodeURI ( repo + branch ) ;
2540
2641 if ( contents ) {
2742
28- link += '/' + encodeURIComponent ( contents ) ;
43+ link += '/' + encodeURI ( contents ) ;
2944
3045 }
3146
You can’t perform that action at this time.
0 commit comments