summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorLaurent Goubet2013-04-10 03:05:36 (EDT)
committer Gerrit Code Review @ Eclipse.org2013-07-09 18:51:36 (EDT)
commit344c6bb9630666402ab014184617dcf9cb33b765 (patch)
tree78f8470b13684e763a189f0be302b98e01402f5f
parent385ae3f4c81f0e095201a09872edb4d59c773364 (diff)
downloadegit-344c6bb9630666402ab014184617dcf9cb33b765.zip
egit-344c6bb9630666402ab014184617dcf9cb33b765.tar.gz
egit-344c6bb9630666402ab014184617dcf9cb33b765.tar.bz2
Ambiguous parameter namingrefs/changes/65/11765/4
What GitFileRevision really expects is a path, not a file name. Most usages of the constructors already passed in a file path... but the parameter naming led to a number of clients to use a file name, which creates FileRevisions with no resolvable path. This fixes all ambiguous parameter names and usages. Change-Id: Id597d427555f71a6b4f422acb06a1faf26c796bd
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/CommitFileRevision.java10
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/GitFileRevision.java4
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/IndexFileRevision.java10
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/WorkingTreeFileRevision.java2
-rw-r--r--org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/WorkspaceFileRevision.java2
5 files changed, 14 insertions, 14 deletions
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/CommitFileRevision.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/CommitFileRevision.java
index e9d690d..ee0f2ca 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/CommitFileRevision.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/CommitFileRevision.java
@@ -47,17 +47,17 @@ class CommitFileRevision extends GitFileRevision {
private ObjectId blobId;
CommitFileRevision(final Repository repo, final RevCommit rc,
- final String fileName) {
- this(repo, rc, fileName, null);
+ final String path) {
+ this(repo, rc, path, null);
}
CommitFileRevision(final Repository repo, final RevCommit rc,
- final String fileName, final ObjectId blob) {
- super(fileName);
+ final String path, final ObjectId blob) {
+ super(path);
db = repo;
commit = rc;
author = rc.getAuthorIdent();
- path = fileName;
+ this.path = path;
blobId = blob;
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/GitFileRevision.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/GitFileRevision.java
index c9e0cf4..c896514 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/GitFileRevision.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/GitFileRevision.java
@@ -85,8 +85,8 @@ public abstract class GitFileRevision extends FileRevision {
private final String path;
- GitFileRevision(final String fileName) {
- path = fileName;
+ GitFileRevision(final String path) {
+ this.path = path;
}
public String getName() {
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/IndexFileRevision.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/IndexFileRevision.java
index 429cb4d..a9bb41d 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/IndexFileRevision.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/IndexFileRevision.java
@@ -40,14 +40,14 @@ public class IndexFileRevision extends GitFileRevision {
private ObjectId blobId;
- IndexFileRevision(final Repository repo, final String fileName) {
- this(repo, fileName, FIRST_AVAILABLE);
+ IndexFileRevision(final Repository repo, final String path) {
+ this(repo, path, FIRST_AVAILABLE);
}
- IndexFileRevision(final Repository repo, final String fileName, int stage) {
- super(fileName);
+ IndexFileRevision(final Repository repo, final String path, int stage) {
+ super(path);
this.db = repo;
- this.path = fileName;
+ this.path = path;
this.stage = stage;
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/WorkingTreeFileRevision.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/WorkingTreeFileRevision.java
index fce50d1..4c0d855 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/WorkingTreeFileRevision.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/WorkingTreeFileRevision.java
@@ -30,7 +30,7 @@ public class WorkingTreeFileRevision extends GitFileRevision {
* @param file
*/
public WorkingTreeFileRevision(final File file) {
- super(file.getName());
+ super(file.getPath());
this.file = file;
}
diff --git a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/WorkspaceFileRevision.java b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/WorkspaceFileRevision.java
index 25ee2b2..0ab709d 100644
--- a/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/WorkspaceFileRevision.java
+++ b/org.eclipse.egit.core/src/org/eclipse/egit/core/internal/storage/WorkspaceFileRevision.java
@@ -24,7 +24,7 @@ public class WorkspaceFileRevision extends GitFileRevision {
* @param resource
*/
public WorkspaceFileRevision(final IResource resource) {
- super(resource.getName());
+ super(resource.getLocation().toString());
rsrc = resource;
}