mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
RUBY-17096 IDEA-132779 github: open browser links by hash
This commit is contained in:
@@ -142,17 +142,12 @@ public class GithubOpenInBrowserAction extends DumbAwareAction {
|
||||
|
||||
String relativePath = path.substring(rootPath.length());
|
||||
|
||||
String branch = getCurrentBranchNameOnRemote(repository);
|
||||
if (branch != null) {
|
||||
return makeUrlToOpen(editor, relativePath, branch, githubRemoteUrl);
|
||||
}
|
||||
|
||||
String hash = getCurrentFileRevisionHash(project, virtualFile);
|
||||
if (hash != null) {
|
||||
return makeUrlToOpen(editor, relativePath, hash, githubRemoteUrl);
|
||||
}
|
||||
|
||||
GithubNotifications.showError(project, CANNOT_OPEN_IN_BROWSER, "Can't find related tracked branch or hash.");
|
||||
GithubNotifications.showError(project, CANNOT_OPEN_IN_BROWSER, "Can't get last revision.");
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -210,7 +205,7 @@ public class GithubOpenInBrowserAction extends DumbAwareAction {
|
||||
@Override
|
||||
public void run(@NotNull ProgressIndicator indicator) {
|
||||
try {
|
||||
ref.set((GitRevisionNumber)GitHistoryUtils.getCurrentRevision(project, VcsUtil.getFilePath(file), null));
|
||||
ref.set((GitRevisionNumber)GitHistoryUtils.getCurrentRevision(project, VcsUtil.getFilePath(file), "HEAD"));
|
||||
}
|
||||
catch (VcsException e) {
|
||||
LOG.warn(e);
|
||||
|
||||
Reference in New Issue
Block a user