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
* 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));
}
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;
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;
* @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;
}
/**
* @return the id of the content
*/
- public LongObjectId getOid() {
+ public AnyLongObjectId getOid() {
return oid;
}
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);
}
@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;
}
}