File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99// @homepageURL https://github.com/jerone/UserScripts/tree/master/Github_Pull_Request_From
1010// @downloadURL https://github.com/jerone/UserScripts/raw/master/Github_Pull_Request_From/Github_Pull_Request_From.user.js
1111// @updateURL https://github.com/jerone/UserScripts/raw/master/Github_Pull_Request_From/Github_Pull_Request_From.user.js
12- // @version 11
12+ // @version 12
1313// @grant none
1414// @include https://github.com/*/*
1515// ==/UserScript==
2828 function init ( ) {
2929 var repo = document . querySelector ( ".js-current-repository" ) . textContent ;
3030 Array . prototype . forEach . call ( document . querySelectorAll ( "span.commit-ref.current-branch" ) , function ( treeSpan ) {
31+ if ( treeSpan . querySelector ( ".unknown-repo" ) ) { return ; }
3132 var tree = treeSpan . textContent . trim ( ) . split ( ":" ) ;
3233 var treeLink = document . createElement ( "a" ) ;
3334 treeLink . setAttribute ( "href" , String . format ( "https://github.com/{0}/{1}/tree/{2}" ,
Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ Make pull request original branch linkable.
2121
2222### Version History
2323
24+ * ** 12**
25+ * Don't link "unknown repository" (fixes https://github.com/jerone/UserScripts/issues/22 );
2426* ** 11**
2527 * Fixed issues after recent layout updates;
2628 * Added native & TamperMonkey for Google Chrome compatibility;
You can’t perform that action at this time.
0 commit comments