summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.lfs
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2016-10-26 22:27:44 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2016-10-26 23:03:39 +0200
commit4b7747ccff99be241a1256319d1c825cbe264e07 (patch)
tree005f22b8f5c5e0dff29541a3d87f7cc9b0356f0f /org.eclipse.jgit.lfs
parent6dea5ec823c861de0a1490b2c6f9573e329e7e44 (diff)
downloadjgit-4b7747ccff99be241a1256319d1c825cbe264e07.tar.gz
jgit-4b7747ccff99be241a1256319d1c825cbe264e07.zip
Use AnyLongObjectId instead of LongObjectId in LFS API
Change-Id: I083ad1ea3e8d3685df7c306854c2498c92b05ffb Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.lfs')
-rw-r--r--org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/Lfs.java6
-rw-r--r--org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPointer.java11
2 files changed, 9 insertions, 8 deletions
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/Lfs.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/Lfs.java
index f099c5a761..75e34e0f63 100644
--- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/Lfs.java
+++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/Lfs.java
@@ -46,7 +46,7 @@ import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
-import org.eclipse.jgit.lfs.lib.LongObjectId;
+import org.eclipse.jgit.lfs.lib.AnyLongObjectId;
/**
* Class which represents the lfs folder hierarchy inside a .git folder
@@ -104,8 +104,8 @@ public class Lfs {
* underneath
* "<repo>/.git/lfs/objects/<firstTwoLettersOfID>/<remainingLettersOfID>"
*/
- public Path getMediaFile(LongObjectId id) {
- String idStr = LongObjectId.toString(id);
+ public Path getMediaFile(AnyLongObjectId id) {
+ String idStr = id.name();
return getLfsObjDir().resolve(idStr.substring(0, 2))
.resolve(idStr.substring(2));
}
diff --git a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPointer.java b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPointer.java
index e43cb2563b..c0cf2337be 100644
--- a/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPointer.java
+++ b/org.eclipse.jgit.lfs/src/org/eclipse/jgit/lfs/LfsPointer.java
@@ -50,6 +50,7 @@ import java.io.OutputStream;
import java.io.PrintStream;
import org.eclipse.jgit.annotations.Nullable;
+import org.eclipse.jgit.lfs.lib.AnyLongObjectId;
import org.eclipse.jgit.lfs.lib.Constants;
import org.eclipse.jgit.lfs.lib.LongObjectId;
@@ -71,7 +72,7 @@ public class LfsPointer {
public static final String HASH_FUNCTION_NAME = Constants.LONG_HASH_FUNCTION
.toLowerCase().replace("-", ""); //$NON-NLS-1$ //$NON-NLS-2$
- private LongObjectId oid;
+ private AnyLongObjectId oid;
private long size;
@@ -81,7 +82,7 @@ public class LfsPointer {
* @param size
* the size of the content
*/
- public LfsPointer(LongObjectId oid, long size) {
+ public LfsPointer(AnyLongObjectId oid, long size) {
this.oid = oid;
this.size = size;
}
@@ -89,7 +90,7 @@ public class LfsPointer {
/**
* @return the id of the content
*/
- public LongObjectId getOid() {
+ public AnyLongObjectId getOid() {
return oid;
}
@@ -112,7 +113,7 @@ public class LfsPointer {
ps.print("version "); //$NON-NLS-1$
ps.println(VERSION);
ps.print("oid " + HASH_FUNCTION_NAME + ":"); //$NON-NLS-1$ //$NON-NLS-2$
- ps.println(LongObjectId.toString(oid));
+ ps.println(oid.name());
ps.print("size "); //$NON-NLS-1$
ps.println(size);
}
@@ -160,7 +161,7 @@ public class LfsPointer {
@Override
public String toString() {
- return "LfsPointer: oid=" + LongObjectId.toString(oid) + ", size=" //$NON-NLS-1$ //$NON-NLS-2$
+ return "LfsPointer: oid=" + oid.name() + ", size=" //$NON-NLS-1$ //$NON-NLS-2$
+ size;
}
}