1 /*******************************************************************************
2 * Copyright (C) 2015, Obeo.
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *******************************************************************************/
9 package org
.eclipse
.egit
.core
.internal
.merge
;
11 import org
.eclipse
.egit
.core
.synchronize
.GitRemoteResource
;
12 import org
.eclipse
.jgit
.lib
.PersonIdent
;
13 import org
.eclipse
.team
.internal
.core
.mapping
.ResourceVariantFileRevision
;
16 * The default implementation of ResourceVariantFileRevision has no author,
17 * comment, timestamp... or any information that could be provided by the Git
18 * resource variant. This implementation uses the variant's information.
20 class GitResourceVariantFileRevision
extends ResourceVariantFileRevision
{
22 public GitResourceVariantFileRevision(GitRemoteResource variant
) {
27 public GitRemoteResource
getVariant() {
28 return (GitRemoteResource
) super.getVariant();
32 public String
getContentIdentifier() {
33 // Use the same ID as would CommitFileRevision
34 return getVariant().getCommitId().getId().getName();
38 public long getTimestamp() {
39 final PersonIdent author
= getVariant().getCommitId().getAuthorIdent();
41 return author
.getWhen().getTime();
43 return super.getTimestamp();
47 public String
getAuthor() {
48 final PersonIdent author
= getVariant().getCommitId().getAuthorIdent();
50 return author
.getName();
52 return super.getAuthor();
56 public String
getComment() {
57 return getVariant().getCommitId().getFullMessage();