Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java3
-rw-r--r--org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/revision/FileRevisionEditorInput.java11
2 files changed, 12 insertions, 2 deletions
diff --git a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java
index 5a4c294cc..f2a0d12ff 100644
--- a/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java
+++ b/org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java
@@ -406,7 +406,8 @@ public class HistoryViewTest extends LocalRepositoryTestCase {
.click();
// Editor for old file version should be opened
- bot.editorByTitle(FILE1 + " " + commit.getParent(0).getName());
+ bot.editorByTitle(
+ FILE1 + " " + commit.getParent(0).getName().substring(0, 7));
}
@Test
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/revision/FileRevisionEditorInput.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/revision/FileRevisionEditorInput.java
index ad5fe3ec3..f054fecd8 100644
--- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/revision/FileRevisionEditorInput.java
+++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/revision/FileRevisionEditorInput.java
@@ -32,6 +32,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.PlatformObject;
import org.eclipse.egit.core.AdapterUtils;
+import org.eclipse.egit.core.internal.storage.CommitFileRevision;
import org.eclipse.egit.ui.Activator;
import org.eclipse.egit.ui.internal.PreferenceBasedDateFormatter;
import org.eclipse.egit.ui.internal.UIText;
@@ -202,9 +203,17 @@ public class FileRevisionEditorInput extends PlatformObject implements
public String getName() {
IFileRevision rev = AdapterUtils.adapt(this, IFileRevision.class);
if (rev != null) {
+ String identifier;
+ if (rev instanceof CommitFileRevision) {
+ // 7 characters as in Utils.getShortObjectId(), used in the
+ // window title
+ identifier = rev.getContentIdentifier().substring(0, 7);
+ } else {
+ identifier = rev.getContentIdentifier();
+ }
return MessageFormat.format(
UIText.FileRevisionEditorInput_NameAndRevisionTitle,
- rev.getName(), rev.getContentIdentifier());
+ rev.getName(), identifier);
}
IFileState state = AdapterUtils.adapt(this, IFileState.class);
if (state != null) {

Back to the top