diff options
author | Zhen Chen <czhen@google.com> | 2017-06-20 15:22:09 -0700 |
---|---|---|
committer | Zhen Chen <czhen@google.com> | 2017-07-26 10:12:29 -0700 |
commit | 2c2999643f64c25a1db1d664c5f563c878559ef2 (patch) | |
tree | 232dca08c3f7361de0f78a691b84419d90149bf4 /org.eclipse.jgit/src/org/eclipse/jgit/transport/PackedObjectInfo.java | |
parent | 82f68500c0dfedd98e0769888a46eff7899c5ab7 (diff) | |
download | jgit-2c2999643f64c25a1db1d664c5f563c878559ef2.tar.gz jgit-2c2999643f64c25a1db1d664c5f563c878559ef2.zip |
Add dfs fsck implementation
JGit already had some fsck-like classes like ObjectChecker which can
check for an individual object.
The read-only FsckPackParser which will parse all objects within a pack
file and check it with ObjectChecker. It will also check the pack index
file against the object information from the pack parser.
Change-Id: Ifd8e0d28eb68ff0b8edd2b51b2fa3a50a544c855
Signed-off-by: Zhen Chen <czhen@google.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/transport/PackedObjectInfo.java')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/PackedObjectInfo.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackedObjectInfo.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackedObjectInfo.java index 6da1c578c2..381c22893b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackedObjectInfo.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackedObjectInfo.java @@ -45,6 +45,7 @@ package org.eclipse.jgit.transport; import org.eclipse.jgit.lib.AnyObjectId; +import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.ObjectIdOwnerMap; /** @@ -59,6 +60,8 @@ public class PackedObjectInfo extends ObjectIdOwnerMap.Entry { private int crc; + private int type = Constants.OBJ_BAD; + PackedObjectInfo(final long headerOffset, final int packedCRC, final AnyObjectId id) { super(id); @@ -112,4 +115,24 @@ public class PackedObjectInfo extends ObjectIdOwnerMap.Entry { public void setCRC(final int crc) { this.crc = crc; } + + /** + * @return the object type. The default type is OBJ_BAD, which is considered + * as unknown or invalid type. + * @since 4.9 + */ + public int getType() { + return type; + } + + /** + * Record the object type if applicable. + * + * @param type + * the object type. + * @since 4.9 + */ + public void setType(int type) { + this.type = type; + } } |