Skip to content

Commit c35e89d

Browse files
committed
* Don't link "unknown repository" (fixes jerone#22);
1 parent fe24258 commit c35e89d

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

Github_Pull_Request_From/Github_Pull_Request_From.user.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
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==
@@ -28,6 +28,7 @@
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}",

Github_Pull_Request_From/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
 (0)